Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67911
b: refs/heads/master
c: 5395353
h: refs/heads/master
i:
  67909: 1fbe6c9
  67907: 59ea39a
  67903: 077b110
v: v3
  • Loading branch information
Benedikt Spranger authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent c291fb5 commit f30e0f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dcfbd97a695a3c28a867501127fa35ac49bc805
refs/heads/master: 5395353e0c8272fe73ac914acd7e4add0da2bef0
12 changes: 12 additions & 0 deletions trunk/drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,8 +1957,20 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
}

spin_lock_irqsave(&dev->req_lock, flags);
/*
* this freelist can be empty if an interrupt triggered disconnect()
* and reconfigured the gadget (shutting down this queue) after the
* network stack decided to xmit but before we got the spinlock.
*/
if (list_empty(&dev->tx_reqs)) {
spin_unlock_irqrestore(&dev->req_lock, flags);
return 1;
}

req = container_of (dev->tx_reqs.next, struct usb_request, list);
list_del (&req->list);

/* temporarily stop TX queue when the freelist empties */
if (list_empty (&dev->tx_reqs))
netif_stop_queue (net);
spin_unlock_irqrestore(&dev->req_lock, flags);
Expand Down

0 comments on commit f30e0f8

Please sign in to comment.