Skip to content

Commit

Permalink
Staging: w35und: unregister device from the ieee80211 stack upon ->di…
Browse files Browse the repository at this point in the history
…sconnect()

Impact: fix module removal

This patch fixes an oops when the w35und module is removed from the
kernel and added back.

Reported-by: luoyi <luoyi.ly@gmail.com>
Tested-by: Sandro Bonazzola <sandro.bonazzola@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pekka Enberg authored and Greg Kroah-Hartman committed May 9, 2009
1 parent 091bf76 commit 82fbb01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/staging/winbond/wbusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
if (err)
goto error_free_hw;

usb_set_intfdata(intf, priv);
usb_set_intfdata(intf, dev);

return 0;

Expand Down Expand Up @@ -415,10 +415,15 @@ static void wb35_hw_halt(struct wbsoft_priv *adapter)

static void wb35_disconnect(struct usb_interface *intf)
{
struct wbsoft_priv *priv = usb_get_intfdata(intf);
struct ieee80211_hw *hw = usb_get_intfdata(intf);
struct wbsoft_priv *priv = hw->priv;

wb35_hw_halt(priv);

ieee80211_stop_queues(hw);
ieee80211_unregister_hw(hw);
ieee80211_free_hw(hw);

usb_set_intfdata(intf, NULL);
usb_put_dev(interface_to_usbdev(intf));
}
Expand Down

0 comments on commit 82fbb01

Please sign in to comment.