diff mbox series

ALSA: hda/cs35l56: Do some clean up on probe error

Message ID 465160f4-b7cf-41d5-931e-d6c9e68fa3c7@moroto.mountain
State Accepted
Commit 367ef1e1c4b65acc5d789ba00d20197eb66b62f4
Headers show
Series ALSA: hda/cs35l56: Do some clean up on probe error | expand

Commit Message

Dan Carpenter July 27, 2023, 7:16 a.m. UTC
Smatch complains that this return should be a goto:

    sound/pci/hda/cs35l56_hda.c:910 cs35l56_hda_common_probe()
    warn: missing unwind goto?

The goto error disables cansleep so that seems reasonable.

Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 sound/pci/hda/cs35l56_hda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Fitzgerald July 27, 2023, 9:51 a.m. UTC | #1
On 27/7/23 08:16, Dan Carpenter wrote:
> Smatch complains that this return should be a goto:
> 
>      sound/pci/hda/cs35l56_hda.c:910 cs35l56_hda_common_probe()
>      warn: missing unwind goto?
> 
> The goto error disables cansleep so that seems reasonable.
> 
> Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   sound/pci/hda/cs35l56_hda.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
> index 71e95e64f8a4..4c3279f61b94 100644
> --- a/sound/pci/hda/cs35l56_hda.c
> +++ b/sound/pci/hda/cs35l56_hda.c
> @@ -907,7 +907,7 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int id)
>   
>   	ret = cs35l56_set_patch(&cs35l56->base);
>   	if (ret)
> -		return ret;
> +		goto err;
>   
>   	regcache_mark_dirty(cs35l56->base.regmap);
>   	regcache_sync(cs35l56->base.regmap);

Thanks.

Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Takashi Iwai July 27, 2023, 9:54 a.m. UTC | #2
On Thu, 27 Jul 2023 09:16:33 +0200,
Dan Carpenter wrote:
> 
> Smatch complains that this return should be a goto:
> 
>     sound/pci/hda/cs35l56_hda.c:910 cs35l56_hda_common_probe()
>     warn: missing unwind goto?
> 
> The goto error disables cansleep so that seems reasonable.
> 
> Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Thanks, applied now.


Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
index 71e95e64f8a4..4c3279f61b94 100644
--- a/sound/pci/hda/cs35l56_hda.c
+++ b/sound/pci/hda/cs35l56_hda.c
@@ -907,7 +907,7 @@  int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int id)
 
 	ret = cs35l56_set_patch(&cs35l56->base);
 	if (ret)
-		return ret;
+		goto err;
 
 	regcache_mark_dirty(cs35l56->base.regmap);
 	regcache_sync(cs35l56->base.regmap);