Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ebcf3ede6d84bf8aeff4378035d3fb312ede8dc9
Commit:     ebcf3ede6d84bf8aeff4378035d3fb312ede8dc9
Parent:     7d28e74b97c8eb859fd9f5eb018bb1c75627bd55
Author:     Oliver Neukum <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 20 13:54:05 2007 +0100
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:28:37 2007 -0700

    USB: sierra close race
    
    the sierra driver does not directly use usb_kill_urb(). It uses a wrapper.
    This wrapper means that callbacks which are running are not killed during
    close, resubmitting and illicitly pushing data into the tty layer.
    The whole purpose of usb_kill_urb() is subverted. The wrapper must be 
removed.
    The same problem as the option driver.
    
    Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/serial/sierra.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index ecedd83..4865aff 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -456,12 +456,6 @@ static int sierra_open(struct usb_serial_port *port, 
struct file *filp)
        return (0);
 }
 
-static inline void stop_urb(struct urb *urb)
-{
-       if (urb && urb->status == -EINPROGRESS)
-               usb_kill_urb(urb);
-}
-
 static void sierra_close(struct usb_serial_port *port, struct file *filp)
 {
        int i;
@@ -479,9 +473,9 @@ static void sierra_close(struct usb_serial_port *port, 
struct file *filp)
 
                /* Stop reading/writing urbs */
                for (i = 0; i < N_IN_URB; i++)
-                       stop_urb(portdata->in_urbs[i]);
+                       usb_unlink_urb(portdata->in_urbs[i]);
                for (i = 0; i < N_OUT_URB; i++)
-                       stop_urb(portdata->out_urbs[i]);
+                       usb_unlink_urb(portdata->out_urbs[i]);
        }
        port->tty = NULL;
 }
@@ -585,9 +579,9 @@ static void sierra_shutdown(struct usb_serial *serial)
                port = serial->port[i];
                portdata = usb_get_serial_port_data(port);
                for (j = 0; j < N_IN_URB; j++)
-                       stop_urb(portdata->in_urbs[j]);
+                       usb_unlink_urb(portdata->in_urbs[j]);
                for (j = 0; j < N_OUT_URB; j++)
-                       stop_urb(portdata->out_urbs[j]);
+                       usb_unlink_urb(portdata->out_urbs[j]);
        }
 
        /* Now free them */
-
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