Staging: w35und: usb_put_dev() is missing from wb35_disconnect()
authorPekka Enberg <penberg@cs.helsinki.fi>
Mon, 27 Oct 2008 21:29:31 +0000 (23:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:51:44 +0000 (13:51 -0800)
The wb35_probe() function does usb_get_dev() so add a missing usb_put_dev() to
the wb35_disconnect() function. Also fix error handling paths in wb35_probe()
to call usb_put_dev() as well.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/winbond/linux/wbusb.c

index eb115034498a4a5d5de16caf85b514fbffc0803d..d9c3a16c415677528aae127753fd0485bbac6192 100644 (file)
@@ -275,6 +275,7 @@ error_free_hw:
 error_free_adapter:
        kfree(adapter);
 error:
+       usb_put_dev(udev);
        return err;
 }
 
@@ -308,12 +309,12 @@ void packet_came(char *pRxBufferAddress, int PacketSize)
 
 static void wb35_disconnect(struct usb_interface *intf)
 {
-       struct wb35_adapter * adapter = usb_get_intfdata(intf);
-       usb_set_intfdata(intf, NULL);
+       struct wb35_adapter *adapter = usb_get_intfdata(intf);
 
-       // Card remove
        WbWlanHalt(adapter);
 
+       usb_set_intfdata(intf, NULL);
+       usb_put_dev(interface_to_usbdev(intf));
 }
 
 static struct usb_driver wb35_driver = {