mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs()
@ 2023-01-05 15:53 Nathan Chancellor
  2023-01-05 17:04 ` Mukunda,Vijendar
  2023-01-09 16:49 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Nathan Chancellor @ 2023-01-05 15:53 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: Vijendar.Mukunda, Syed.SabaKareem, alsa-devel, linux-kernel,
	llvm, Nathan Chancellor

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.

Return -ENODEV, which matches the debug message's description of this block.

Fixes: 1d325cdaf7a2 ("ASoC: amd: ps: refactor platform device creation logic")
Link: https://github.com/ClangBuiltLinux/linux/issues/1779
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/soc/amd/ps/pci-ps.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c
index 401cfd0036be..f54b9fd9c3ce 100644
--- a/sound/soc/amd/ps/pci-ps.c
+++ b/sound/soc/amd/ps/pci-ps.c
@@ -217,6 +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");
+		ret = -ENODEV;
 		goto de_init;
 	}
 

---
base-commit: 03178b4f7e2c59ead102e5ab5acb82ce1eaefe46
change-id: 20230105-wsometimes-uninitialized-pci-ps-c-3b5725c6ed31

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-09 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 15:53 [PATCH] ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs() Nathan Chancellor
2023-01-05 17:04 ` Mukunda,Vijendar
2023-01-05 17:11   ` [PATCH] ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs()m Nathan Chancellor
2023-01-05 17:34     ` [PATCH] ASoC: amd: ps: Fix uninitialized ret in create_acp64_platform_devs() Nathan Chancellor
2023-01-05 23:39       ` Mukunda,Vijendar
2023-01-09 16:49 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®