sound: usb: Fix error handling path
Commit 2733ec307cd5 ("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:
parent
c49b56e4f7
commit
6c7f709360
@ -1204,7 +1204,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];
|
||||
|
Loading…
Reference in New Issue
Block a user