From 3488d3d84ce4a47e637b2d79bfa29a175be9f0ea Mon Sep 17 00:00:00 2001 From: Wesley Cheng Date: Tue, 16 Jul 2024 15:16:08 -0700 Subject: [PATCH] sound: usb: usb_audio_qmi_svc: Set QMI return status correctly on error In some of the exit early conditions, the ret value is not overridden with an error code. This would lead to a condition where the QMI response status would be zero (success), while other fields are not properly populated. The error condition in question is: uaudio_err("invalid substream\n"); Address this by setting the ret value manually in case of an error condition. This would allow for the audio DSP to treat the QMI response as a failure versus attempting to continue processing it. The issue was seen if the audio device is disconnected shortly after attempting to start the audio session. Change-Id: Ibf4198bb15ba490f665accba2f8459cfc4810b34 Signed-off-by: Wesley Cheng Signed-off-by: Udipto Goswami --- sound/usb/usb_audio_qmi_svc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/usb/usb_audio_qmi_svc.c b/sound/usb/usb_audio_qmi_svc.c index 659fdd5b3fb9..799a38c86066 100644 --- a/sound/usb/usb_audio_qmi_svc.c +++ b/sound/usb/usb_audio_qmi_svc.c @@ -1569,6 +1569,7 @@ static void handle_uaudio_stream_req(struct qmi_handle *handle, if (!subs) { uaudio_err("invalid substream\n"); + ret = -EINVAL; goto response; }