]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Intel: mrfld: fix uninitialized variable access
authorArnd Bergmann <arnd@arndb.de>
Sat, 3 Nov 2018 21:21:22 +0000 (22:21 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 5 Nov 2018 10:38:19 +0000 (10:38 +0000)
commit47271db691205a04a988d8a8b6f768df2257792e
tree0d7a4def0312deee132e230a5401af0cfcdf97b4
parent1d6937d76310991373c9eb3721228fca6d23f3da
ASoC: Intel: mrfld: fix uninitialized variable access

Randconfig testing revealed a very old bug, with gcc-8:

sound/soc/intel/atom/sst/sst_loader.c: In function 'sst_load_fw':
sound/soc/intel/atom/sst/sst_loader.c:357:5: error: 'fw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  if (fw == NULL) {
     ^
sound/soc/intel/atom/sst/sst_loader.c:354:25: note: 'fw' was declared here
  const struct firmware *fw;

We must check the return code of request_firmware() before we look at the
pointer result that may be uninitialized when the function fails.

Fixes: a1194c2b77f9 ("ASoC: Intel: mrfld - Add DSP load and management")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/atom/sst/sst_loader.c