Commit d66aed99 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.

commit e3eb270f upstream.

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ace53ef6
...@@ -1099,6 +1099,8 @@ static int device_close(struct net_device *dev) ...@@ -1099,6 +1099,8 @@ static int device_close(struct net_device *dev)
memset(pMgmt->abyCurrBSSID, 0, 6); memset(pMgmt->abyCurrBSSID, 0, 6);
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
pDevice->flags &= ~DEVICE_FLAGS_OPENED;
device_free_tx_bufs(pDevice); device_free_tx_bufs(pDevice);
device_free_rx_bufs(pDevice); device_free_rx_bufs(pDevice);
device_free_int_bufs(pDevice); device_free_int_bufs(pDevice);
...@@ -1110,7 +1112,6 @@ static int device_close(struct net_device *dev) ...@@ -1110,7 +1112,6 @@ static int device_close(struct net_device *dev)
usb_free_urb(pDevice->pInterruptURB); usb_free_urb(pDevice->pInterruptURB);
BSSvClearNodeDBTable(pDevice, 0); BSSvClearNodeDBTable(pDevice, 0);
pDevice->flags &=(~DEVICE_FLAGS_OPENED);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment