Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfb7267a authored by Michael Wu's avatar Michael Wu Committed by John W. Linville
Browse files

[PATCH] mac80211: remove rtnl locking in ieee80211_sta.c



The rtnl is held in ieee80211_sta.c to prevent some potential
configuration races with userspace. Unfortunately, it also has the
potential for deadlocks on interface down. This patch removes the
rtnl locking to eliminate the deadlocks.

Signed-off-by: default avatarMichael Wu <flamingice@sourmilk.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 33ccad35
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -25,7 +25,6 @@
#include <linux/wireless.h>
#include <linux/wireless.h>
#include <linux/random.h>
#include <linux/random.h>
#include <linux/etherdevice.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>
#include <net/iw_handler.h>
#include <net/iw_handler.h>
#include <asm/types.h>
#include <asm/types.h>


@@ -2107,12 +2106,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
	struct ieee80211_sta_bss *bss, *selected = NULL;
	struct ieee80211_sta_bss *bss, *selected = NULL;
	int top_rssi = 0, freq;
	int top_rssi = 0, freq;


	rtnl_lock();

	if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel &&
	if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel &&
	    !ifsta->auto_ssid_sel) {
	    !ifsta->auto_ssid_sel) {
		ifsta->state = IEEE80211_AUTHENTICATE;
		ifsta->state = IEEE80211_AUTHENTICATE;
		rtnl_unlock();
		ieee80211_sta_reset_auth(dev, ifsta);
		ieee80211_sta_reset_auth(dev, ifsta);
		return 0;
		return 0;
	}
	}
@@ -2155,7 +2151,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
		ieee80211_sta_set_bssid(dev, selected->bssid);
		ieee80211_sta_set_bssid(dev, selected->bssid);
		ieee80211_rx_bss_put(dev, selected);
		ieee80211_rx_bss_put(dev, selected);
		ifsta->state = IEEE80211_AUTHENTICATE;
		ifsta->state = IEEE80211_AUTHENTICATE;
		rtnl_unlock();
		ieee80211_sta_reset_auth(dev, ifsta);
		ieee80211_sta_reset_auth(dev, ifsta);
		return 0;
		return 0;
	} else {
	} else {
@@ -2166,7 +2161,6 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
		} else
		} else
			ifsta->state = IEEE80211_DISABLED;
			ifsta->state = IEEE80211_DISABLED;
	}
	}
	rtnl_unlock();
	return -1;
	return -1;
}
}