]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.4.65/staging-vt6656-main_usb.c-oops-on-device_close-move-flag-earlier.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.65 / staging-vt6656-main_usb.c-oops-on-device_close-move-flag-earlier.patch
CommitLineData
f9370a80
GKH
1From e3eb270fab7734427dd8171a93e4946fe28674bc Mon Sep 17 00:00:00 2001
2From: Malcolm Priestley <tvboxspy@gmail.com>
3Date: Sun, 22 Sep 2013 19:48:54 +0100
4Subject: staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.
5
6From: Malcolm Priestley <tvboxspy@gmail.com>
7
8commit e3eb270fab7734427dd8171a93e4946fe28674bc upstream.
9
10The vt6656 is prone to resetting on the usb bus.
11
12It seems there is a race condition and wpa supplicant is
13trying to open the device via iw_handlers before its actually
14closed at a stage that the buffers are being removed.
15
16The device is longer considered open when the
17buffers are being removed. So move ~DEVICE_FLAGS_OPENED
18flag to before freeing the device buffers.
19
20Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23---
24 drivers/staging/vt6656/main_usb.c | 3 ++-
25 1 file changed, 2 insertions(+), 1 deletion(-)
26
27--- a/drivers/staging/vt6656/main_usb.c
28+++ b/drivers/staging/vt6656/main_usb.c
29@@ -1220,6 +1220,8 @@ device_release_WPADEV(pDevice);
30 memset(pMgmt->abyCurrBSSID, 0, 6);
31 pMgmt->eCurrState = WMAC_STATE_IDLE;
32
33+ pDevice->flags &= ~DEVICE_FLAGS_OPENED;
34+
35 device_free_tx_bufs(pDevice);
36 device_free_rx_bufs(pDevice);
37 device_free_int_bufs(pDevice);
38@@ -1231,7 +1233,6 @@ device_release_WPADEV(pDevice);
39 usb_free_urb(pDevice->pInterruptURB);
40
41 BSSvClearNodeDBTable(pDevice, 0);
42- pDevice->flags &=(~DEVICE_FLAGS_OPENED);
43
44 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");
45