public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp()
@ 2023-10-30  7:08 Harshit Mogalapalli
  2023-10-31 17:31 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Harshit Mogalapalli @ 2023-10-30  7:08 UTC (permalink / raw)
  To: James Schulman, David Rhodes, Richard Fitzgerald, Jaroslav Kysela,
	Takashi Iwai, Stefan Binding, alsa-devel, patches, linux-kernel
  Cc: dan.carpenter, kernel-janitors, error27, harshit.m.mogalapalli

When firmware status is invalid, assign -EINVAL to ret as ret is '0' at
that point and returning success is incorrect when firmware status is
invalid.

Fixes: a51d8ba03a4f ("ALSA: hda: cs35l41: Check CSPL state after loading firmware")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
This is found using smatch and only compile tested.
---
 sound/pci/hda/cs35l41_hda.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 496ff6a9d300..09f8d8fa4c71 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -1042,6 +1042,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
 	default:
 		dev_err(cs35l41->dev, "Firmware status is invalid: %u\n",
 			fw_status);
+		ret = -EINVAL;
 		goto clean_dsp;
 	}
 
-- 
2.39.3


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

* Re: [PATCH next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp()
  2023-10-30  7:08 [PATCH next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() Harshit Mogalapalli
@ 2023-10-31 17:31 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-10-31 17:31 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: James Schulman, David Rhodes, Richard Fitzgerald, Jaroslav Kysela,
	Takashi Iwai, Stefan Binding, alsa-devel, patches, linux-kernel,
	dan.carpenter, kernel-janitors, error27

On Mon, 30 Oct 2023 08:08:36 +0100,
Harshit Mogalapalli wrote:
> 
> When firmware status is invalid, assign -EINVAL to ret as ret is '0' at
> that point and returning success is incorrect when firmware status is
> invalid.
> 
> Fixes: a51d8ba03a4f ("ALSA: hda: cs35l41: Check CSPL state after loading firmware")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Thanks, applied now.


Takashi


> ---
> This is found using smatch and only compile tested.
> ---
>  sound/pci/hda/cs35l41_hda.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
> index 496ff6a9d300..09f8d8fa4c71 100644
> --- a/sound/pci/hda/cs35l41_hda.c
> +++ b/sound/pci/hda/cs35l41_hda.c
> @@ -1042,6 +1042,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41)
>  	default:
>  		dev_err(cs35l41->dev, "Firmware status is invalid: %u\n",
>  			fw_status);
> +		ret = -EINVAL;
>  		goto clean_dsp;
>  	}
>  
> -- 
> 2.39.3
> 

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

end of thread, other threads:[~2023-11-03 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  7:08 [PATCH next] ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() Harshit Mogalapalli
2023-10-31 17:31 ` Takashi Iwai

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