Skip to contentSkip to conversation

b43: work around a locking issue in ->set_tim()

PATCH In review Felix Fietkau 2 participants 2 messages Nov 7, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43: work around a locking issue in ->set_tim()

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.

---

drivers/net/wireless/b43/main.c +1 -2
@@ -4534,9 +4534,8 @@ static int b43_op_beacon_set_tim(struct
 {
 	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;
 }
maintainer
#1 lore raw
Quoted 3 lines · Felix Fietkau

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.

According to me, that's pretty much impossible... But patches welcome, of course. :)

johannes