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 <[EMAIL PROTECTED]>

---
 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);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to