patch "usb: iowarrior: fix deadlock on disconnect" added to usb-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
usb: iowarrior: fix deadlock on disconnect
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From c468a8aa790e0dfe0a7f8a39db282d39c2c00b46 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Thu, 8 Aug 2019 11:27:28 +0200
Subject: usb: iowarrior: fix deadlock on disconnect
We have to drop the mutex before we close() upon disconnect() as close() needs the lock. This is safe to do by dropping the mutex as intfdata is already set to NULL, so open() will fail.
--- drivers/usb/misc/iowarrior.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/misc/iowarrior.c +4 -3
@@ -866,19 +866,20 @@ static void iowarrior_disconnect(struct usb_interface *interface) dev =usb_get_intfdata (interface);mutex_lock (&iowarrior_open_disc_lock);usb_set_intfdata (interface,NULL ); +/* prevent device read, write and ioctl */ + dev->present =0 ; minor = dev->minor; +mutex_unlock (&iowarrior_open_disc_lock); +/* give back our minor - this will call close() locks need to be dropped at this point*/ -/* give back our minor */ usb_deregister_dev (interface, &iowarrior_class);mutex_lock (&dev->mutex);/* prevent device read, write and ioctl */ - dev->present =0 ;mutex_unlock (&dev->mutex); -mutex_unlock (&iowarrior_open_disc_lock);if (dev->opened) {/* There is a process that holds a filedescriptor to the device ,
Signature · 1 line
2.22.0