alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe
@ 2023-04-11 17:09 Ying Liu
  2023-04-12 16:46 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ying Liu @ 2023-04-11 17:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: HUST OS Kernel Contribution, Ying Liu, alsa-devel, linux-kernel

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@hust.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


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

* Re: [PATCH] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe
  2023-04-11 17:09 [PATCH] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe Ying Liu
@ 2023-04-12 16:46 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-04-12 16:46 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Ying Liu
  Cc: HUST OS Kernel Contribution, alsa-devel, linux-kernel

On Wed, 12 Apr 2023 01:09:12 +0800, Ying Liu wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe
      commit: d93ee84e3eb5d1afc081e57ca37f1411a01f2c94

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2023-04-12 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-11 17:09 [PATCH] ASoC: tas5720: add missing unwind goto in tas5720_codec_probe Ying Liu
2023-04-12 16:46 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).