From b1cbe0d98dcbcddb7bd84fe8eed97cdc5a82c807 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 5 Jan 2023 17:43:39 -0700 Subject: [PATCH] ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs() Clang warns: sound/soc/amd/ps/pci-ps.c:218:2: error: variable 'ret' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] default: ^~~~~~~ sound/soc/amd/ps/pci-ps.c:239:9: note: uninitialized use occurs here return ret; ^~~ sound/soc/amd/ps/pci-ps.c:190:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 error generated. ret is used uninitialized if 'goto de_init' is taken. As this is not an error nor should the ACP be deinitialized, just directly return 0 in this case statement, which resolves the warning. Fixes: 1d325cdaf7a2 ("ASoC: amd: ps: refactor platform device creation logic") Link: https://github.com/ClangBuiltLinux/linux/issues/1779 Suggested-by: Vijendar Mukunda Signed-off-by: Nathan Chancellor --- sound/soc/amd/ps/pci-ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 401cfd0036bed8..64648b75de6b0a 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -217,7 +217,7 @@ static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data break; default: dev_dbg(&pci->dev, "No PDM devices found\n"); - goto de_init; + return 0; } for (index = 0; index < adata->pdev_count; index++) {