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

Commit 03c08e69 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "HID: uhid: Remove mutex_unlock while waiting"

parents 20bc5aec 10175e0f
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -188,27 +188,9 @@ static int __uhid_report_queue_and_wait(struct uhid_device *uhid,
	uhid_queue(uhid, ev);
	spin_unlock_irqrestore(&uhid->qlock, flags);

	/*
	 * Assumption: report_lock and devlock are both locked. So unlock
	 * before sleeping.
	 */
	mutex_unlock(&uhid->report_lock);
	mutex_unlock(&uhid->devlock);
	ret = wait_event_interruptible_timeout(uhid->report_wait,
				!uhid->report_running || !uhid->running,
				5 * HZ);
	ret = mutex_lock_interruptible(&uhid->devlock);
	if (ret)
		return ret;
	ret = mutex_lock_interruptible(&uhid->report_lock);
	if (ret) {
		/*
		 * Failed to lock, unlock previous mutex before exiting
		 * this function.
		 */
		mutex_unlock(&uhid->devlock);
		return ret;
	}
	if (!ret || !uhid->running || uhid->report_running)
		ret = -EIO;
	else if (ret < 0)