b43: work around a locking issue in ->set_tim()
authorFelix Fietkau <nbd@openwrt.org>
Sat, 7 Nov 2009 17:37:37 +0000 (18:37 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Nov 2009 21:21:12 +0000 (16:21 -0500)
ops->set_tim() must be atomic, so b43 trying to acquire a mutex leads
to a kernel crash. This patch trades an easy to trigger crash in AP
mode for an unlikely race condition. According to Michael, the real
fix would be to allow set_tim() to sleep, since b43 is not the only
driver that needs to sleep in all callbacks.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c

index 86f35827f0085a19d01d94624c4f2aee3603df3f..098dda1a67c13af65abb94e3c5bb0bd2a7c4a816 100644 (file)
@@ -4521,9 +4521,8 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
 {
        struct b43_wl *wl = hw_to_b43_wl(hw);
 
-       mutex_lock(&wl->mutex);
+       /* FIXME: add locking */
        b43_update_templates(wl);
-       mutex_unlock(&wl->mutex);
 
        return 0;
 }