Skip to content

Commit

Permalink
ASoC: intel: initialize return value properly
Browse files Browse the repository at this point in the history
When CONFIG_SND_SOC_HDAC_HDMI is disabled, we can run into an
uninitialized variable:

sound/soc/intel/skylake/skl.c: In function 'skl_resume':
sound/soc/intel/skylake/skl.c:326:6: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I have run into this on today's linux-next kernel, but it appears
that this is an older problem that was just hard to trigger
with randconfig builds as CONFIG_SND_SOC_HDAC_HDMI would in
effect be impossible to disable when having SND_SOC_INTEL_SKYLAKE
enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Mark Brown committed Nov 7, 2017
1 parent adebc53 commit cc20c4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/intel/skylake/skl.c
Original file line number Diff line number Diff line change
@@ -355,6 +355,7 @@ static int skl_resume(struct device *dev)

if (ebus->cmd_dma_state)
snd_hdac_bus_init_cmd_io(&ebus->bus);
ret = 0;
} else {
ret = _skl_resume(ebus);

0 comments on commit cc20c4d

Please sign in to comment.