summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2007-05-07 10:33:18 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-06-26 10:38:05 +0400
commit944dc184f6fe0dc63633099ba87cb75fe4ee0c51 (patch)
tree10dd3bf2d600e2fc8884c6581ed0f2b80af8cf74
parent8cfbe7e60d9618d8f80a3cd218c45dd64cb9e5cf (diff)
downloadlinux-944dc184f6fe0dc63633099ba87cb75fe4ee0c51.tar.xz
USB: ti serial driver sleeps with spinlock held
you are submitting an URB with GFP_KERNEL holding a spinlock. In this case the spinlock can be dropped earlier. Signed-off-by: Oliver Neukum <oneukum@suse.de> Cc: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 4203e2b1a761..3d505fd0645b 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1555,15 +1555,17 @@ static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty)
spin_lock_irqsave(&tport->tp_lock, flags);
if (tport->tp_read_urb_state == TI_READ_URB_STOPPED) {
+ tport->tp_read_urb_state = TI_READ_URB_RUNNING;
urb = tport->tp_port->read_urb;
+ spin_unlock_irqrestore(&tport->tp_lock, flags);
urb->complete = ti_bulk_in_callback;
urb->context = tport;
urb->dev = tport->tp_port->serial->dev;
status = usb_submit_urb(urb, GFP_KERNEL);
+ } else {
+ tport->tp_read_urb_state = TI_READ_URB_RUNNING;
+ spin_unlock_irqrestore(&tport->tp_lock, flags);
}
- tport->tp_read_urb_state = TI_READ_URB_RUNNING;
-
- spin_unlock_irqrestore(&tport->tp_lock, flags);
return status;
}