]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: u_ether: synchronize with transmit when stopping queue
authorJeff Westfahl <jeff.westfahl@ni.com>
Thu, 29 May 2014 06:49:41 +0000 (09:49 +0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 19 Jun 2014 15:06:46 +0000 (10:06 -0500)
commit4b1685cb66ce7cbcfe51185b266b34f6fb895faf
treefc5be5559891d8aaf0b4bfeb8fc395f63456162d
parent66a38a4f0ff4825bb6189a9c3cfbe786cad78d9f
usb: gadget: u_ether: synchronize with transmit when stopping queue

When disconnecting, it's possible that another thread has already made it
into eth_start_xmit before we call netif_stop_queue. This can lead to a
crash as eth_start_xmit tries to use resources that gether_disconnect is
freeing. Use netif_tx_lock/unlock around netif_stop_queue to ensure no
threads are executing during the remainder of gether_disconnect.

Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Tested-by: Jaeden Amero <jaeden.amero@ni.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/u_ether.c