]>
Commit | Line | Data |
---|---|---|
f9370a80 GKH |
1 | From e3eb270fab7734427dd8171a93e4946fe28674bc Mon Sep 17 00:00:00 2001 |
2 | From: Malcolm Priestley <tvboxspy@gmail.com> | |
3 | Date: Sun, 22 Sep 2013 19:48:54 +0100 | |
4 | Subject: staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier. | |
5 | ||
6 | From: Malcolm Priestley <tvboxspy@gmail.com> | |
7 | ||
8 | commit e3eb270fab7734427dd8171a93e4946fe28674bc upstream. | |
9 | ||
10 | The vt6656 is prone to resetting on the usb bus. | |
11 | ||
12 | It seems there is a race condition and wpa supplicant is | |
13 | trying to open the device via iw_handlers before its actually | |
14 | closed at a stage that the buffers are being removed. | |
15 | ||
16 | The device is longer considered open when the | |
17 | buffers are being removed. So move ~DEVICE_FLAGS_OPENED | |
18 | flag to before freeing the device buffers. | |
19 | ||
20 | Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> | |
21 | Signed-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 |