diff options
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f9819d10b1f9..edb81ed06950 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -359,10 +359,12 @@ static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb, | |||
359 | void usbnet_defer_kevent (struct usbnet *dev, int work) | 359 | void usbnet_defer_kevent (struct usbnet *dev, int work) |
360 | { | 360 | { |
361 | set_bit (work, &dev->flags); | 361 | set_bit (work, &dev->flags); |
362 | if (!schedule_work (&dev->kevent)) | 362 | if (!schedule_work (&dev->kevent)) { |
363 | netdev_err(dev->net, "kevent %d may have been dropped\n", work); | 363 | if (net_ratelimit()) |
364 | else | 364 | netdev_err(dev->net, "kevent %d may have been dropped\n", work); |
365 | } else { | ||
365 | netdev_dbg(dev->net, "kevent %d scheduled\n", work); | 366 | netdev_dbg(dev->net, "kevent %d scheduled\n", work); |
367 | } | ||
366 | } | 368 | } |
367 | EXPORT_SYMBOL_GPL(usbnet_defer_kevent); | 369 | EXPORT_SYMBOL_GPL(usbnet_defer_kevent); |
368 | 370 | ||
@@ -1158,6 +1160,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
1158 | usb_anchor_urb(urb, &dev->deferred); | 1160 | usb_anchor_urb(urb, &dev->deferred); |
1159 | /* no use to process more packets */ | 1161 | /* no use to process more packets */ |
1160 | netif_stop_queue(net); | 1162 | netif_stop_queue(net); |
1163 | usb_put_urb(urb); | ||
1161 | spin_unlock_irqrestore(&dev->txq.lock, flags); | 1164 | spin_unlock_irqrestore(&dev->txq.lock, flags); |
1162 | netdev_dbg(dev->net, "Delaying transmission for resumption\n"); | 1165 | netdev_dbg(dev->net, "Delaying transmission for resumption\n"); |
1163 | goto deferred; | 1166 | goto deferred; |
@@ -1310,6 +1313,8 @@ void usbnet_disconnect (struct usb_interface *intf) | |||
1310 | 1313 | ||
1311 | cancel_work_sync(&dev->kevent); | 1314 | cancel_work_sync(&dev->kevent); |
1312 | 1315 | ||
1316 | usb_scuttle_anchored_urbs(&dev->deferred); | ||
1317 | |||
1313 | if (dev->driver_info->unbind) | 1318 | if (dev->driver_info->unbind) |
1314 | dev->driver_info->unbind (dev, intf); | 1319 | dev->driver_info->unbind (dev, intf); |
1315 | 1320 | ||