Skip to content

Commit b272f42

Browse files
harshimogalapallitiwai
authored andcommitted
ALSA: qc_audio_offload: Fix missing error code in prepare_qmi_response()
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 <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Fixes: 326bbc3 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support") Signed-off-by: Harshit Mogalapalli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 41c6646 commit b272f42

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sound/usb/qcom/qc_audio_offload.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,20 +1360,21 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
13601360

13611361
if (!uadev[card_num].ctrl_intf) {
13621362
dev_err(&subs->dev->dev, "audio ctrl intf info not cached\n");
1363-
ret = -ENODEV;
1364-
goto err;
1363+
return -ENODEV;
13651364
}
13661365

13671366
ret = uaudio_populate_uac_desc(subs, resp);
13681367
if (ret < 0)
1369-
goto err;
1368+
return ret;
13701369

13711370
resp->slot_id = subs->dev->slot_id;
13721371
resp->slot_id_valid = 1;
13731372

13741373
data = snd_soc_usb_find_priv_data(uaudio_qdev->auxdev->dev.parent);
1375-
if (!data)
1376-
goto err;
1374+
if (!data) {
1375+
dev_err(&subs->dev->dev, "No private data found\n");
1376+
return -ENODEV;
1377+
}
13771378

13781379
uaudio_qdev->data = data;
13791380

@@ -1382,7 +1383,7 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
13821383
&resp->xhci_mem_info.tr_data,
13831384
&resp->std_as_data_ep_desc);
13841385
if (ret < 0)
1385-
goto err;
1386+
return ret;
13861387

13871388
resp->std_as_data_ep_desc_valid = 1;
13881389

@@ -1500,7 +1501,6 @@ static int prepare_qmi_response(struct snd_usb_substream *subs,
15001501
xhci_sideband_remove_endpoint(uadev[card_num].sb,
15011502
usb_pipe_endpoint(subs->dev, subs->data_endpoint->pipe));
15021503

1503-
err:
15041504
return ret;
15051505
}
15061506

0 commit comments

Comments
 (0)