Commit aee6841f authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[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.
parent 04af2203
......@@ -232,8 +232,10 @@ static int belkin_sa_open (struct usb_serial_port *port, struct file *filp)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment