[PATCH 14/15][SRU][J][V2] ASoC: amd: fix uninitialized variable in snd_acp6x_probe()
Alex Hung
alex.hung at canonical.com
Thu Jan 6 18:41:16 UTC 2022
From: Dan Carpenter <dan.carpenter at oracle.com>
BugLink: https://bugs.launchpad.net/bugs/1949245
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 at oracle.com>
Link: https://lore.kernel.org/r/20211130125633.GA24941@kili
Signed-off-by: Mark Brown <broonie at kernel.org>
(cherry picked from commit d5c137f41352e8dd864522c417b45d8d1aebca68)
Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
sound/soc/amd/yc/pci-acp6x.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c
index 957eeb6..7e9a9a9 100644
--- a/sound/soc/amd/yc/pci-acp6x.c
+++ b/sound/soc/amd/yc/pci-acp6x.c
@@ -146,10 +146,11 @@ static int snd_acp6x_probe(struct pci_dev *pci,
{
struct acp6x_dev_data *adata;
struct platform_device_info pdevinfo[ACP6x_DEVS];
- int ret, index;
+ int index = 0;
int val = 0x00;
u32 addr;
unsigned int irqflags;
+ int ret;
irqflags = IRQF_SHARED;
/* Yellow Carp device check */
--
2.7.4
More information about the kernel-team
mailing list