Skip to content

Commit

Permalink
rtl8187: Fix module so that rmmod/insmod does not error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jan 12, 2009
1 parent 124b68e commit d6e2be9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/rtl818x/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) {
kfree_skb(skb);
return -ENOMEM;
return NETDEV_TX_OK;
}

flags = skb->len;
Expand Down Expand Up @@ -281,7 +281,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
}
usb_free_urb(urb);

return rc;
return NETDEV_TX_OK;
}

static void rtl8187_rx_cb(struct urb *urb)
Expand Down Expand Up @@ -1471,6 +1471,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf)
ieee80211_unregister_hw(dev);

priv = dev->priv;
usb_reset_device(priv->udev);
usb_put_dev(interface_to_usbdev(intf));
ieee80211_free_hw(dev);
}
Expand Down

0 comments on commit d6e2be9

Please sign in to comment.