diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8af576c1d2f1..699d97b8de5e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -33,6 +33,8 @@ nl80211_type_to_mac80211_type(enum nl80211_iftype type) | |||
33 | case NL80211_IFTYPE_MESH_POINT: | 33 | case NL80211_IFTYPE_MESH_POINT: |
34 | return IEEE80211_IF_TYPE_MESH_POINT; | 34 | return IEEE80211_IF_TYPE_MESH_POINT; |
35 | #endif | 35 | #endif |
36 | case NL80211_IFTYPE_WDS: | ||
37 | return IEEE80211_IF_TYPE_WDS; | ||
36 | default: | 38 | default: |
37 | return IEEE80211_IF_TYPE_INVALID; | 39 | return IEEE80211_IF_TYPE_INVALID; |
38 | } | 40 | } |
@@ -718,12 +720,18 @@ static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev, | |||
718 | struct sta_info *sta; | 720 | struct sta_info *sta; |
719 | 721 | ||
720 | if (mac) { | 722 | if (mac) { |
723 | rcu_read_lock(); | ||
724 | |||
721 | /* XXX: get sta belonging to dev */ | 725 | /* XXX: get sta belonging to dev */ |
722 | sta = sta_info_get(local, mac); | 726 | sta = sta_info_get(local, mac); |
723 | if (!sta) | 727 | if (!sta) { |
728 | rcu_read_unlock(); | ||
724 | return -ENOENT; | 729 | return -ENOENT; |
730 | } | ||
725 | 731 | ||
726 | sta_info_unlink(&sta); | 732 | sta_info_unlink(&sta); |
733 | rcu_read_unlock(); | ||
734 | |||
727 | sta_info_destroy(sta); | 735 | sta_info_destroy(sta); |
728 | } else | 736 | } else |
729 | sta_info_flush(local, sdata); | 737 | sta_info_flush(local, sdata); |
@@ -740,17 +748,23 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
740 | struct sta_info *sta; | 748 | struct sta_info *sta; |
741 | struct ieee80211_sub_if_data *vlansdata; | 749 | struct ieee80211_sub_if_data *vlansdata; |
742 | 750 | ||
751 | rcu_read_lock(); | ||
752 | |||
743 | /* XXX: get sta belonging to dev */ | 753 | /* XXX: get sta belonging to dev */ |
744 | sta = sta_info_get(local, mac); | 754 | sta = sta_info_get(local, mac); |
745 | if (!sta) | 755 | if (!sta) { |
756 | rcu_read_unlock(); | ||
746 | return -ENOENT; | 757 | return -ENOENT; |
758 | } | ||
747 | 759 | ||
748 | if (params->vlan && params->vlan != sta->sdata->dev) { | 760 | if (params->vlan && params->vlan != sta->sdata->dev) { |
749 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 761 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
750 | 762 | ||
751 | if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN || | 763 | if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN || |
752 | vlansdata->vif.type != IEEE80211_IF_TYPE_AP) | 764 | vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { |
765 | rcu_read_unlock(); | ||
753 | return -EINVAL; | 766 | return -EINVAL; |
767 | } | ||
754 | 768 | ||
755 | sta->sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 769 | sta->sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
756 | ieee80211_send_layer2_update(sta); | 770 | ieee80211_send_layer2_update(sta); |
@@ -758,6 +772,8 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
758 | 772 | ||
759 | sta_apply_parameters(local, sta, params); | 773 | sta_apply_parameters(local, sta, params); |
760 | 774 | ||
775 | rcu_read_unlock(); | ||
776 | |||
761 | return 0; | 777 | return 0; |
762 | } | 778 | } |
763 | 779 | ||