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

Commit 89092ddd authored by Oliver Neukum's avatar Oliver Neukum Committed by Jiri Kosina
Browse files

HID: fix possible deadlock in usbhid_close()



This patch switches usbhid_close() from flush_scheduled_work() to canceling
the outstanding work. This fixes a possible deadlock due to work taking
the mutex usbhid_close() holds. Lockdep reported the problem.

Signed-off-by: default avatarOliver Neukum <oliver@neukum.org>

--
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 2feaace4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -662,8 +662,8 @@ void usbhid_close(struct hid_device *hid)
	spin_lock_irq(&usbhid->lock);
	if (!--hid->open) {
		spin_unlock_irq(&usbhid->lock);
		hid_cancel_delayed_stuff(usbhid);
		usb_kill_urb(usbhid->urbin);
		flush_scheduled_work();
		usbhid->intf->needs_remote_wakeup = 0;
	} else {
		spin_unlock_irq(&usbhid->lock);