diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-09-25 09:24:59 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-09-25 09:26:55 +0200 |
commit | 9b20aa63b8fc9a6a3b6831f4eae3621755e51211 (patch) | |
tree | 0c379f3f3d84411246b49e1c8557480bb0f1d0b0 /drivers/net/usb/usbnet.c | |
parent | 7ece55a4a3a04abe37118b1d4fb0b702eeb1de4c (diff) | |
parent | 979570e02981d4a8fc20b3cc8fd651856c98ee9d (diff) |
Merge tag 'v3.6-rc7' into core/rcu
Merge Linux 3.6-rc7, to pick up fixes and to resolve a conflict in an
upcoming pull.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index fd4b26d46fd5..fc9f578a1e25 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1201,19 +1201,26 @@ deferred: } EXPORT_SYMBOL_GPL(usbnet_start_xmit); -static void rx_alloc_submit(struct usbnet *dev, gfp_t flags) +static int rx_alloc_submit(struct usbnet *dev, gfp_t flags) { struct urb *urb; int i; + int ret = 0; /* don't refill the queue all at once */ for (i = 0; i < 10 && dev->rxq.qlen < RX_QLEN(dev); i++) { urb = usb_alloc_urb(0, flags); if (urb != NULL) { - if (rx_submit(dev, urb, flags) == -ENOLINK) - return; + ret = rx_submit(dev, urb, flags); + if (ret) + goto err; + } else { + ret = -ENOMEM; + goto err; } } +err: + return ret; } /*-------------------------------------------------------------------------*/ @@ -1257,7 +1264,8 @@ static void usbnet_bh (unsigned long param) int temp = dev->rxq.qlen; if (temp < RX_QLEN(dev)) { - rx_alloc_submit(dev, GFP_ATOMIC); + if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK) + return; if (temp != dev->rxq.qlen) netif_dbg(dev, link, dev->net, "rxqlen %d --> %d\n", |