Thread (22 messages) 22 messages, 8 authors, 2007-02-21
STALE7049d

[PATCH 6/6] d80211: fix rtnl locking in ieee80211_register_hw

From: Jiri Benc <hidden>
Date: 2007-01-29 17:47:59

rtnl locking in ieee80211_register_hw was racy. This patch fixes that.

Unfortunatelly, the creation of master interface has to be still protected
by rtnl lock as we need to protect against addition of a new virtual
interface.

Signed-off-by: Jiri Benc <redacted>

---
 net/d80211/ieee80211.c |    4 +---
 1 files changed, 1 insertion(+), 3 deletions(-)
--- dscape.orig/net/d80211/ieee80211.c
+++ dscape/net/d80211/ieee80211.c
@@ -4540,12 +4540,10 @@ int ieee80211_register_hw(struct ieee802
 
 	result = register_invisible_netdevice(local->mdev);
 	if (result < 0) {
-		rtnl_unlock();
 		goto fail_dev;
 	}
 
 	result = ieee80211_init_rate_ctrl_alg(local, NULL);
-	rtnl_unlock();
 	if (result < 0) {
 		printk(KERN_DEBUG "wiphy%d: Failed to initialize rate control "
 		       "algorithm\n", local->hw.index);
@@ -4564,7 +4562,6 @@ int ieee80211_register_hw(struct ieee802
 	ieee80211_install_qdisc(local->mdev);
 
 	/* add one default STA interface */
-	rtnl_lock();
 	result = ieee80211_if_add(local->mdev, "wlan%d", 1, &sta_dev);
 	if (result == 0)
 		ieee80211_if_set_type(sta_dev, IEEE80211_IF_TYPE_STA);
@@ -4581,6 +4578,7 @@ fail_wep:
 fail_rate:
 	unregister_invisible_netdevice(local->mdev);
 fail_dev:
+	rtnl_unlock();
 	sta_info_stop(local);
 fail_sta_info:
 	ieee80211_dev_sysfs_del(local);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help