Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90803
b: refs/heads/master
c: 98dd6a5
h: refs/heads/master
i:
  90801: bbc7a28
  90799: f3662c6
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 16, 2008
1 parent 55bcaca commit a8c9e82
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 171afcd4ba093b50cd2fb33fe2371fbc1f7fd389
refs/heads/master: 98dd6a575928ed9c42130d208e6bfb0f7a914d5a
20 changes: 17 additions & 3 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -740,24 +746,32 @@ 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);
}

sta_apply_parameters(local, sta, params);

rcu_read_unlock();

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/net/mac80211/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,8 @@ static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct sta_info *sta = NULL;

rcu_read_lock();

if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
sdata->vif.type == IEEE80211_IF_TYPE_IBSS)
sta = sta_info_get(local, sdata->u.sta.bssid);
Expand All @@ -996,6 +998,9 @@ static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev
wstats->qual.noise = sta->last_noise;
wstats->qual.updated = local->wstats_flags;
}

rcu_read_unlock();

return wstats;
}

Expand Down

0 comments on commit a8c9e82

Please sign in to comment.