* [PATCH] ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response()
@ 2025-06-23 14:26 Harshit Mogalapalli
2025-06-24 8:11 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Harshit Mogalapalli @ 2025-06-23 14:26 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Greg Kroah-Hartman, Wesley Cheng,
Mark Brown, Arnd Bergmann, Dan Carpenter, Christophe JAILLET,
Harshit Mogalapalli, linux-sound, linux-kernel
Cc: kernel-janitors, error27
When snd_soc_usb_find_priv_data() fails, return failure instead of
success. While we are at it also use direct returns at first few error
paths where there is no additional cleanup needed.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/Z_40qL4JnyjR4j0O@stanley.mountain/
Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
sound/usb/qcom/qc_audio_offload.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index 5bc27c82e0af..797afd4561bd 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -1360,20 +1360,21 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
if (!uadev[card_num].ctrl_intf) {
dev_err(&subs->dev->dev, "audio ctrl intf info not cached\n");
- ret = -ENODEV;
- goto err;
+ return -ENODEV;
}
ret = uaudio_populate_uac_desc(subs, resp);
if (ret < 0)
- goto err;
+ return ret;
resp->slot_id = subs->dev->slot_id;
resp->slot_id_valid = 1;
data = snd_soc_usb_find_priv_data(uaudio_qdev->auxdev->dev.parent);
- if (!data)
- goto err;
+ if (!data) {
+ dev_err(&subs->dev->dev, "No private data found\n");
+ return -ENODEV;
+ }
uaudio_qdev->data = data;
@@ -1382,7 +1383,7 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
&resp->xhci_mem_info.tr_data,
&resp->std_as_data_ep_desc);
if (ret < 0)
- goto err;
+ return ret;
resp->std_as_data_ep_desc_valid = 1;
@@ -1500,7 +1501,6 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
xhci_sideband_remove_endpoint(uadev[card_num].sb,
usb_pipe_endpoint(subs->dev, subs->data_endpoint->pipe));
-err:
return ret;
}
--
2.39.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response()
2025-06-23 14:26 [PATCH] ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response() Harshit Mogalapalli
@ 2025-06-24 8:11 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-06-24 8:11 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jaroslav Kysela, Takashi Iwai, Greg Kroah-Hartman, Wesley Cheng,
Mark Brown, Arnd Bergmann, Dan Carpenter, Christophe JAILLET,
linux-sound, linux-kernel, kernel-janitors, error27
On Mon, 23 Jun 2025 16:26:27 +0200,
Harshit Mogalapalli wrote:
>
> When snd_soc_usb_find_priv_data() fails, return failure instead of
> success. While we are at it also use direct returns at first few error
> paths where there is no additional cleanup needed.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/all/Z_40qL4JnyjR4j0O@stanley.mountain/
> Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Thanks, applied now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-24 8:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 14:26 [PATCH] ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response() Harshit Mogalapalli
2025-06-24 8:11 ` Takashi Iwai
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).