]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
USB: ipw: fix interface-data memory leak in error path
authorJohan Hovold <jhovold@gmail.com>
Thu, 25 Oct 2012 13:42:39 +0000 (15:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Oct 2012 16:39:37 +0000 (09:39 -0700)
Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

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

index add45b7d8aa7f4b97e2e6b81cded48b43962719d..4264821a3b34fb653d28dafe2171e6b9239ca8e5 100644 (file)
@@ -203,8 +203,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
        return 0;
 }
 
-/* fake probe - only to allocate data structures */
-static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id)
+static int ipw_attach(struct usb_serial *serial)
 {
        struct usb_wwan_intf_private *data;
 
@@ -303,7 +302,7 @@ static struct usb_serial_driver ipw_device = {
        .num_ports =            1,
        .open =                 ipw_open,
        .close =                ipw_close,
-       .probe =                ipw_probe,
+       .attach =               ipw_attach,
        .release =              ipw_release,
        .port_probe =           usb_wwan_port_probe,
        .port_remove =          usb_wwan_port_remove,