Re: [patch]fix possible deadlock in usbhid_close()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Apr 2009, Oliver Neukum wrote:

> 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: Oliver Neukum <oliver@xxxxxxxxxx>
> 
> --
> 
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -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);

Applied, thanks Oliver.

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux