Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfaeafcfc2242277e31cc1cfae687afaac0cd9ec
Commit:     bfaeafcfc2242277e31cc1cfae687afaac0cd9ec
Parent:     ed206ec9ab398e1c3756ff0eb9507db1d009e65f
Author:     Borislav Petkov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 28 13:24:16 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Nov 28 13:58:34 2007 -0800

    usbserial: fix inconsistent lock state
    
    In commit acd2a847e7fee7df11817f67dba75a2802793e5d 
usb_serial_generic_write()
    disables interrupts when taking &port->lock which is also taken in
    usb_serial_generic_read_bulk_callback() resulting in an inconsistent lock 
state
    due to the latter not disabling interrupts on the local cpu. Fix that by
    disabling interrupts in the latter call site also.
    
    Signed-off-by: Borislav Petkov <[EMAIL PROTECTED]>
    Acked-by: Jiri Kosina <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/generic.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 9eb4a65..d415311 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -327,6 +327,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb)
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        unsigned char *data = urb->transfer_buffer;
        int status = urb->status;
+       unsigned long flags;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -339,11 +340,11 @@ void usb_serial_generic_read_bulk_callback (struct urb 
*urb)
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, 
urb->actual_length, data);
 
        /* Throttle the device if requested by tty */
-       spin_lock(&port->lock);
+       spin_lock_irqsave(&port->lock, flags);
        if (!(port->throttled = port->throttle_req))
                /* Handle data and continue reading from device */
                flush_and_resubmit_read_urb(port);
-       spin_unlock(&port->lock);
+       spin_unlock_irqrestore(&port->lock, flags);
 }
 EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to