Skip to content

Commit

Permalink
Staging: w35und: usb_put_dev() is missing from wb35_disconnect()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pekka Enberg authored and Greg Kroah-Hartman committed Jan 6, 2009
1 parent c8b2b70 commit 4af12e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/staging/winbond/linux/wbusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
error_free_adapter:
kfree(adapter);
error:
usb_put_dev(udev);
return err;
}

Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 4af12e5

Please sign in to comment.