sound: usb: Fix error handling path

Commit 2733ec307c ("sound: usb: Clear in_use if wait_event
fails while disconnect") added ENODEV check with EINVAL in the
error path if chip is removed while handling uaudio stream request.
Instead, both the error codes should be checked exclusively in the
return path to avoid NULL pointer access.

Change-Id: Iebf12b6f13fc6a22c679ed3482759c9173004bb8
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
This commit is contained in:
Pratham Pratap
2020-06-24 15:47:36 +05:30
parent 37e541f76d
commit b52f798c52

View File

@@ -1159,7 +1159,7 @@ static void handle_uaudio_stream_req(struct qmi_handle *handle,
mutex_unlock(&chip->dev_lock);
response:
if (!req_msg->enable && (ret != -EINVAL || ret != -ENODEV)) {
if (!req_msg->enable && ret != -EINVAL && ret != -ENODEV) {
mutex_lock(&chip->dev_lock);
if (info_idx >= 0) {
info = &uadev[pcm_card_num].info[info_idx];