[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230411170912.1939906-1-lyre@hust.edu.cn>
Date: Wed, 12 Apr 2023 01:09:12 +0800
From: Ying Liu <lyre@...t.edu.cn>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: HUST OS Kernel Contribution
<hust-os-kernel-patches@...glegroups.com>,
Ying Liu <lyre@...t.edu.cn>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe
Smatch complains that missing unwind goto in tas5720_codec_probe.
When tas5720 has an invalid devtype, it is expected to invoke
regulator_bulk_disable to handle the failure. But the default
option return an error code directly. Fix it by reusing the
probe_fail label.
Signed-off-by: Ying Liu <lyre@...t.edu.cn>
---
The issue is found by static analysis and the patch remains untested.
---
sound/soc/codecs/tas5720.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c
index de6d01c8fdd3..4d27b60bd804 100644
--- a/sound/soc/codecs/tas5720.c
+++ b/sound/soc/codecs/tas5720.c
@@ -339,7 +339,8 @@ static int tas5720_codec_probe(struct snd_soc_component *component)
break;
default:
dev_err(component->dev, "unexpected private driver data\n");
- return -EINVAL;
+ ret = -EINVAL;
+ goto probe_fail;
}
if (device_id != expected_device_id)
--
2.40.0
Powered by blists - more mailing lists