Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ab71a89 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sound: usb: Fix possible race between release and cleanup"

parents e4efd9d6 0ed84179
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1156,17 +1156,17 @@ static void handle_uaudio_stream_req(struct qmi_handle *handle,

response:
	if (!req_msg->enable && ret != -EINVAL) {
		if (info_idx >= 0) {
		mutex_lock(&chip->dev_lock);
		if (info_idx >= 0) {
			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;