Rami Rosen e223b6dc05 rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free().
When running modprobe rt73usb, and then rmmod rt73usb, and then
iwconfig, the wlan0 device does not disappear. When repeating this
process again, we get a kernel Oops errors and "BUG: unable to handle
kernel paging request..." message in the kernel log.

The reason for this is that there is an error in rt2x00rfkill_free(),
which is called in the process of removing the device
(rt2x00lib_remove_dev() in rt2x00dev.c).
rt2x00rfkill_free() clears the RFKILL_STATE_ALLOCATED bit , which is
bit number 1 () in rt2x00dev->flags instead of in
rt2x00dev->rfkill_state. As a result, when checking the
DEVICE_STATE_REGISTERED_HW bit (bit number 1 in rt2x00dev->flags) in
rt2x00lib_remove_hw() it is **unset**, and we wrongly **don't** call
ieee80211_unregister_hw().

This patch corrects this: the parameter for __test_and_clear_bit() in
rt2x00rfkill_free() should be &rt2x00dev->rfkill_state and not
&rt2x00dev->flags.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:24 -05:00
..
2009-01-08 16:29:41 +00:00
2009-01-12 16:37:00 -08:00
2009-01-06 15:59:30 -08:00
2009-01-08 08:31:15 -08:00
2009-01-09 03:39:43 -05:00
2009-01-11 01:34:25 +01:00
2009-01-14 14:42:21 -08:00
2009-01-11 01:34:25 +01:00
2009-01-09 12:37:15 -08:00
2009-01-09 03:39:43 -05:00
2009-01-11 01:34:25 +01:00
2009-01-11 01:34:24 +01:00
2009-01-11 00:05:16 -08:00
2009-01-12 16:37:00 -08:00