ChangeSet 1.1500.8.16, 2004/02/02 13:45:57-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix URB leak in belkin driver

if submission of the interrupt URb fails in belkin_sa_open() the
previously submitted URB may remain live. The rest of the system
thinks that opening failed, therefore the URB should be unlinked
in the error case.


 drivers/usb/serial/belkin_sa.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
--- a/drivers/usb/serial/belkin_sa.c    Mon Feb  9 14:39:56 2004
+++ b/drivers/usb/serial/belkin_sa.c    Mon Feb  9 14:39:56 2004
@@ -232,8 +232,10 @@
 
        port->interrupt_in_urb->dev = port->serial->dev;
        retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
-       if (retval)
+       if (retval) {
+               usb_unlink_urb(port->read_urb);
                err(" usb_submit_urb(read int) failed");
+       }
 
 exit:
        return retval;



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to