staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 22 Sep 2013 18:48:54 +0000 (19:48 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Oct 2013 20:06:06 +0000 (21:06 +0100)
commit7db4eda80eb05f7b0a6c7771920a2eea011b4f80
treeca4115ed4f65904e282f149a2699b08a29549717
parent5c1a25b78eb6480c0c708e21fd746cf8b4dae9e7
staging: vt6656: [BUG] main_usb.c oops on device_close move flag earlier.

commit e3eb270fab7734427dd8171a93e4946fe28674bc 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: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/vt6656/main_usb.c