diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-04-10 15:36:09 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-16 14:53:22 -0400 |
commit | 98dd6a575928ed9c42130d208e6bfb0f7a914d5a (patch) | |
tree | 5fd946b2080a8aa68e75742ea958e768cace46cb /net/mac80211/cfg.c | |
parent | 171afcd4ba093b50cd2fb33fe2371fbc1f7fd389 (diff) | |
download | op-kernel-dev-98dd6a575928ed9c42130d208e6bfb0f7a914d5a.zip op-kernel-dev-98dd6a575928ed9c42130d208e6bfb0f7a914d5a.tar.gz |
mac80211: further RCU fixes
There were a few more instances of sta_info_get calls not being
protected by RCU, fix them.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8af576c..0c1095a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -718,12 +718,18 @@ static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev, struct sta_info *sta; if (mac) { + rcu_read_lock(); + /* XXX: get sta belonging to dev */ sta = sta_info_get(local, mac); - if (!sta) + if (!sta) { + rcu_read_unlock(); return -ENOENT; + } sta_info_unlink(&sta); + rcu_read_unlock(); + sta_info_destroy(sta); } else sta_info_flush(local, sdata); @@ -740,17 +746,23 @@ static int ieee80211_change_station(struct wiphy *wiphy, struct sta_info *sta; struct ieee80211_sub_if_data *vlansdata; + rcu_read_lock(); + /* XXX: get sta belonging to dev */ sta = sta_info_get(local, mac); - if (!sta) + if (!sta) { + rcu_read_unlock(); return -ENOENT; + } if (params->vlan && params->vlan != sta->sdata->dev) { vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN || - vlansdata->vif.type != IEEE80211_IF_TYPE_AP) + vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { + rcu_read_unlock(); return -EINVAL; + } sta->sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); ieee80211_send_layer2_update(sta); @@ -758,6 +770,8 @@ static int ieee80211_change_station(struct wiphy *wiphy, sta_apply_parameters(local, sta, params); + rcu_read_unlock(); + return 0; } |