diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-06 00:11:26 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-12 14:24:56 -0500 |
commit | d6e2be988d5146d1faa8df895cd8b32106d987bd (patch) | |
tree | d462e42c221a86a35af9f6a99d74f811cdbefe54 /drivers/net | |
parent | 124b68e755c2ef9342d5d477142c499fd7901360 (diff) |
rtl8187: Fix module so that rmmod/insmod does not error
Due to misunderstanding of the returned values allowed for the tx callback
of mac80211, rtl8187 was using skb's that had been freed. This problem was
triggered when the module was sujected to a rmmod/insmod cycle.
After that was fixed, the modules would not work after the rmmod/insmod cycle
until the USB device was reset.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 00ce3ef39abe..6ad6bac37706 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -213,7 +213,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
213 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 213 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
214 | if (!urb) { | 214 | if (!urb) { |
215 | kfree_skb(skb); | 215 | kfree_skb(skb); |
216 | return -ENOMEM; | 216 | return NETDEV_TX_OK; |
217 | } | 217 | } |
218 | 218 | ||
219 | flags = skb->len; | 219 | flags = skb->len; |
@@ -281,7 +281,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
281 | } | 281 | } |
282 | usb_free_urb(urb); | 282 | usb_free_urb(urb); |
283 | 283 | ||
284 | return rc; | 284 | return NETDEV_TX_OK; |
285 | } | 285 | } |
286 | 286 | ||
287 | static void rtl8187_rx_cb(struct urb *urb) | 287 | static void rtl8187_rx_cb(struct urb *urb) |
@@ -1471,6 +1471,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1471 | ieee80211_unregister_hw(dev); | 1471 | ieee80211_unregister_hw(dev); |
1472 | 1472 | ||
1473 | priv = dev->priv; | 1473 | priv = dev->priv; |
1474 | usb_reset_device(priv->udev); | ||
1474 | usb_put_dev(interface_to_usbdev(intf)); | 1475 | usb_put_dev(interface_to_usbdev(intf)); |
1475 | ieee80211_free_hw(dev); | 1476 | ieee80211_free_hw(dev); |
1476 | } | 1477 | } |