Commit b447780d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: remove unneeded checks in the usb-serial core.

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent cee6102d
...@@ -452,18 +452,12 @@ static void destroy_serial(struct kref *kref) ...@@ -452,18 +452,12 @@ static void destroy_serial(struct kref *kref)
port = serial->port[i]; port = serial->port[i];
if (!port) if (!port)
continue; continue;
if (port->read_urb) { usb_kill_urb(port->read_urb);
usb_kill_urb(port->read_urb); usb_free_urb(port->read_urb);
usb_free_urb(port->read_urb); usb_kill_urb(port->write_urb);
} usb_free_urb(port->write_urb);
if (port->write_urb) { usb_kill_urb(port->interrupt_in_urb);
usb_kill_urb(port->write_urb); usb_free_urb(port->interrupt_in_urb);
usb_free_urb(port->write_urb);
}
if (port->interrupt_in_urb) {
usb_kill_urb(port->interrupt_in_urb);
usb_free_urb(port->interrupt_in_urb);
}
kfree(port->bulk_in_buffer); kfree(port->bulk_in_buffer);
kfree(port->bulk_out_buffer); kfree(port->bulk_out_buffer);
kfree(port->interrupt_in_buffer); kfree(port->interrupt_in_buffer);
...@@ -799,18 +793,12 @@ static void port_release(struct device *dev) ...@@ -799,18 +793,12 @@ static void port_release(struct device *dev)
struct usb_serial_port *port = to_usb_serial_port(dev); struct usb_serial_port *port = to_usb_serial_port(dev);
dbg ("%s - %s", __FUNCTION__, dev->bus_id); dbg ("%s - %s", __FUNCTION__, dev->bus_id);
if (port->read_urb) { usb_kill_urb(port->read_urb);
usb_kill_urb(port->read_urb); usb_free_urb(port->read_urb);
usb_free_urb(port->read_urb); usb_kill_urb(port->write_urb);
} usb_free_urb(port->write_urb);
if (port->write_urb) { usb_kill_urb(port->interrupt_in_urb);
usb_kill_urb(port->write_urb); usb_free_urb(port->interrupt_in_urb);
usb_free_urb(port->write_urb);
}
if (port->interrupt_in_urb) {
usb_kill_urb(port->interrupt_in_urb);
usb_free_urb(port->interrupt_in_urb);
}
kfree(port->bulk_in_buffer); kfree(port->bulk_in_buffer);
kfree(port->bulk_out_buffer); kfree(port->bulk_out_buffer);
kfree(port->interrupt_in_buffer); kfree(port->interrupt_in_buffer);
......
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