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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2013 14:06:53 +0000 (07:06 -0700)
commite5b46b4a861e37b802af33e2108f170b142ca86f
treea9de8e588c3347738698cff0e48c103a2c9e2fdb
parent96c3df85670b3cf3e070b3065b8b616305bc3208
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>
drivers/staging/vt6656/main_usb.c