summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalcolm Priestley2013-09-22 20:48:54 +0200
committerGreg Kroah-Hartman2013-09-26 01:53:40 +0200
commite3eb270fab7734427dd8171a93e4946fe28674bc (patch)
tree827ab950202b2d8367b6692e50e44db4df8e603a
parentstaging: vt6656: rxtx.c [BUG] s_vGetFreeContext dead lock on null apTD. (diff)
downloadkernel-qcow2-linux-e3eb270fab7734427dd8171a93e4946fe28674bc.tar.gz
kernel-qcow2-linux-e3eb270fab7734427dd8171a93e4946fe28674bc.tar.xz
kernel-qcow2-linux-e3eb270fab7734427dd8171a93e4946fe28674bc.zip
staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.
The vt6656 is prone to resetting on the usb bus. It seems there is a race condition and wpa supplicant is trying to open the device via iw_handlers before its actually closed at a stage that the buffers are being removed. The device is longer considered open when the buffers are being removed. So move ~DEVICE_FLAGS_OPENED flag to before freeing the device buffers. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/vt6656/main_usb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 536971786ae8..6f9d28182445 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1098,6 +1098,8 @@ static int device_close(struct net_device *dev)
memset(pMgmt->abyCurrBSSID, 0, 6);
pMgmt->eCurrState = WMAC_STATE_IDLE;
+ pDevice->flags &= ~DEVICE_FLAGS_OPENED;
+
device_free_tx_bufs(pDevice);
device_free_rx_bufs(pDevice);
device_free_int_bufs(pDevice);
@@ -1109,7 +1111,6 @@ static int device_close(struct net_device *dev)
usb_free_urb(pDevice->pInterruptURB);
BSSvClearNodeDBTable(pDevice, 0);
- pDevice->flags &=(~DEVICE_FLAGS_OPENED);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");