USB: opticon: move read-urb deallocation to release
authorJohan Hovold <jhovold@gmail.com>
Sun, 18 Nov 2012 12:23:28 +0000 (13:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2012 21:33:55 +0000 (13:33 -0800)
Move read-urb deallocation from disconnect to release.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/opticon.c

index e275abb..77700b0 100644 (file)
@@ -523,13 +523,13 @@ static void opticon_disconnect(struct usb_serial *serial)
        struct opticon_private *priv = usb_get_serial_data(serial);
 
        usb_kill_urb(priv->bulk_read_urb);
-       usb_free_urb(priv->bulk_read_urb);
 }
 
 static void opticon_release(struct usb_serial *serial)
 {
        struct opticon_private *priv = usb_get_serial_data(serial);
 
+       usb_free_urb(priv->bulk_read_urb);
        kfree(priv->bulk_in_buffer);
        kfree(priv);
 }