Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: amd: fix uninitialized variable in snd_acp6x_probe()

The "index" is potentially used without being initialized on the error
path.

Fixes: fc329c1de498 ("ASoC: amd: add platform devices for acp6x pdm driver and dmic driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211130125633.GA24941@kili
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
d5c137f4 53689f7f

+2 -1
+2 -1
sound/soc/amd/yc/pci-acp6x.c
··· 146 146 { 147 147 struct acp6x_dev_data *adata; 148 148 struct platform_device_info pdevinfo[ACP6x_DEVS]; 149 - int ret, index; 149 + int index = 0; 150 150 int val = 0x00; 151 151 u32 addr; 152 152 unsigned int irqflags; 153 + int ret; 153 154 154 155 irqflags = IRQF_SHARED; 155 156 /* Yellow Carp device check */