wimax/i2400m: fix oops caused by race condition when exiting USB kthreads
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Wed, 7 Oct 2009 23:11:38 +0000 (08:11 +0900)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:56:22 +0000 (15:56 +0900)
commit4a78fd9a736db4c871bc8b583d66b61c38abd299
tree2f8e5c53eb81091c321436b70280b9627e673815
parent0c96859d7a5f0286ed70d3c4e140ac6816a350da
wimax/i2400m: fix oops caused by race condition when exiting USB kthreads

Current i2400m USB code had to threads (one for processing RX, one for
TX). When calling i2400m_{tx,rx}_release(), it would crash if the
thread had exited already due to an error.

So changed the code to have the thread fill in/out
i2400mu->{tx,rx}_kthread under a spinlock; then the _release()
function will call kthread_stop() only if {rx,tx}_kthread is still
set.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/usb-rx.c
drivers/net/wimax/i2400m/usb-tx.c