mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
sound: usb: Fix possible race between release and cleanup
In a case where the physical disconnect of headset and the disable call from QMI race with each other, there is a possibility that usb_sec_event_ring_cleanup is called at the same time from uaudio_dev_cleanup and uaudio_dev_release leading to kernel panic. Fix this by seriailizing both these calls using the dev_lock mutex. Change-Id: I88abccca704786446e0826fc60994c9580828156 Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
This commit is contained in:
parent
d88ee8d05d
commit
c49b56e4f7
1 changed files with 2 additions and 2 deletions
|
|
@ -1205,19 +1205,19 @@ static void handle_uaudio_stream_req(struct qmi_handle *handle,
|
|||
|
||||
response:
|
||||
if (!req_msg->enable && (ret != -EINVAL || ret != -ENODEV)) {
|
||||
mutex_lock(&chip->dev_lock);
|
||||
if (info_idx >= 0) {
|
||||
mutex_lock(&chip->dev_lock);
|
||||
info = &uadev[pcm_card_num].info[info_idx];
|
||||
uaudio_dev_intf_cleanup(
|
||||
uadev[pcm_card_num].udev,
|
||||
info);
|
||||
uaudio_dbg("release resources: intf# %d card# %d\n",
|
||||
subs->interface, pcm_card_num);
|
||||
mutex_unlock(&chip->dev_lock);
|
||||
}
|
||||
if (atomic_read(&uadev[pcm_card_num].in_use))
|
||||
kref_put(&uadev[pcm_card_num].kref,
|
||||
uaudio_dev_release);
|
||||
mutex_unlock(&chip->dev_lock);
|
||||
}
|
||||
|
||||
resp.usb_token = req_msg->usb_token;
|
||||
|
|
|
|||
Loading…
Reference in a new issue