Hi, sending a separate patch for usb-serial.c.
Description: - corrected handling when unlinking read URB's, that were synchronous, usb_kill_urb() is used from now on. - removed unnecessary checks for NULL, as those are handled internally by the usb framework Thanks for applying, Jan Jan Capek - CCS Inc. Firmware developer Signed-off-by: Jan Capek <[EMAIL PROTECTED]> -------------------------------------------------------------------
--- linux-2.6.9-rc1-mm1/drivers/usb/serial/usb-serial.c 2004-09-08 04:51:23.000000000 +0200 +++ linux-2.6.9-rc1-mm1-ccs/drivers/usb/serial/usb-serial.c 2004-09-08 15:31:11.000000000 +0200 @@ -14,6 +14,14 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * + * (09/08/2004) Jan Capek + * destroy_serial(), port_release() - removed test on URB's being NULL as + * these checks are always performed by underlying usb_kill_urb(), + * usb_unlink_urb, usb_free_urb() resp. Further, port->read_urb is now + * removed synchronously using usb_kill_urb() instead of usb_unlink_urb(). + * This is to ensure consistency with the urb.c, so that usb_unlink_urb() + * is not used for synchronous unlinking anymore. + * * (12/10/2002) gkh * Split the ports off into their own struct device, and added a * usb-serial bus driver. @@ -454,18 +462,15 @@ port = serial->port[i]; if (!port) continue; - if (port->read_urb) { - usb_unlink_urb(port->read_urb); - usb_free_urb(port->read_urb); - } - if (port->write_urb) { - usb_unlink_urb(port->write_urb); - usb_free_urb(port->write_urb); - } - if (port->interrupt_in_urb) { - usb_unlink_urb(port->interrupt_in_urb); - usb_free_urb(port->interrupt_in_urb); - } + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + + usb_unlink_urb(port->write_urb); + usb_free_urb(port->write_urb); + + usb_unlink_urb(port->interrupt_in_urb); + usb_free_urb(port->interrupt_in_urb); + kfree(port->bulk_in_buffer); kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer); @@ -818,18 +823,16 @@ struct usb_serial_port *port = to_usb_serial_port(dev); dbg ("%s - %s", __FUNCTION__, dev->bus_id); - if (port->read_urb) { - usb_unlink_urb(port->read_urb); - usb_free_urb(port->read_urb); - } - if (port->write_urb) { - usb_unlink_urb(port->write_urb); - usb_free_urb(port->write_urb); - } - if (port->interrupt_in_urb) { - usb_unlink_urb(port->interrupt_in_urb); - usb_free_urb(port->interrupt_in_urb); - } + + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + + usb_unlink_urb(port->write_urb); + usb_free_urb(port->write_urb); + + usb_unlink_urb(port->interrupt_in_urb); + usb_free_urb(port->interrupt_in_urb); + kfree(port->bulk_in_buffer); kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer);