From: Johannes Berg Date: Wed, 19 Jun 2013 16:55:06 +0000 (+0200) Subject: Merge remote-tracking branch 'mac80211/master' into HEAD X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f93beba705842af466e7c916b39630cacb40e9c6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge remote-tracking branch 'mac80211/master' into HEAD Merge mac80211 to avoid conflicts with the nl80211 attrbuf changes. Conflicts: net/mac80211/iface.c net/wireless/nl80211.c Signed-off-by: Johannes Berg --- f93beba705842af466e7c916b39630cacb40e9c6 diff --cc net/mac80211/iface.c index 7cabaf261fed,98d20c0f6fed..a2a8250e2f84 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@@ -159,10 -159,10 +159,11 @@@ static int ieee80211_change_mtu(struct return 0; } - static int ieee80211_verify_mac(struct ieee80211_local *local, u8 *addr, -static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr) ++static int ieee80211_verify_mac(struct ieee80211_sub_if_data *sdata, u8 *addr, + bool check_dup) { - struct ieee80211_sub_if_data *sdata; + struct ieee80211_local *local = sdata->local; + struct ieee80211_sub_if_data *iter; u64 new, mask, tmp; u8 *m; int ret = 0; @@@ -180,16 -180,16 +181,19 @@@ ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); + if (!check_dup) + return ret; mutex_lock(&local->iflist_mtx); - list_for_each_entry(sdata, &local->interfaces, list) { - if (sdata->vif.type == NL80211_IFTYPE_MONITOR && - !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE)) + list_for_each_entry(iter, &local->interfaces, list) { + if (iter == sdata) continue; - m = sdata->vif.addr; - if (iter->vif.type == NL80211_IFTYPE_MONITOR) ++ if (iter->vif.type == NL80211_IFTYPE_MONITOR && ++ !(iter->u.mntr_flags & MONITOR_FLAG_ACTIVE)) + continue; + + m = iter->vif.addr; tmp = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) | ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) | ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8); @@@ -214,11 -213,7 +218,11 @@@ static int ieee80211_change_mac(struct if (ieee80211_sdata_running(sdata)) return -EBUSY; - ret = ieee80211_verify_mac(sdata, sa->sa_data); + if (sdata->vif.type == NL80211_IFTYPE_MONITOR && + !(sdata->u.mntr_flags & MONITOR_FLAG_ACTIVE)) + check_dup = false; + - ret = ieee80211_verify_mac(sdata->local, sa->sa_data, check_dup); ++ ret = ieee80211_verify_mac(sdata, sa->sa_data, check_dup); if (ret) return ret; diff --cc net/mac80211/mlme.c index e0939eb79060,741448b30825..34d54fe81483 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@@ -2653,12 -2743,16 +2723,15 @@@ static bool ieee80211_assoc_success(str ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt); ieee80211_sta_reset_beacon_monitor(sdata); - return true; + ret = true; + out: + kfree(bss_ies); + return ret; } -static enum rx_mgmt_action __must_check -ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, - struct ieee80211_mgmt *mgmt, size_t len, - struct cfg80211_bss **bss) +static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, + struct ieee80211_mgmt *mgmt, + size_t len) { struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data; diff --cc net/wireless/nl80211.c index 4ab1ffa9df11,b14b7e3cb6e6..f8ffb9a59c83 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@@ -1527,12 -1564,17 +1527,17 @@@ static int nl80211_dump_wiphy(struct sk struct cfg80211_registered_device *dev; s64 filter_wiphy = -1; bool split = false; - struct nlattr **tb = nl80211_fam.attrbuf; + struct nlattr **tb; int res; + /* will be zeroed in nlmsg_parse() */ + tb = kmalloc(sizeof(*tb) * (NL80211_ATTR_MAX + 1), GFP_KERNEL); + if (!tb) + return -ENOMEM; + - mutex_lock(&cfg80211_mutex); + rtnl_lock(); res = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, - tb, nl80211_fam.maxattr, nl80211_policy); + tb, NL80211_ATTR_MAX, nl80211_policy); if (res == 0) { split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP]; if (tb[NL80211_ATTR_WIPHY]) @@@ -1545,7 -1587,8 +1550,8 @@@ netdev = dev_get_by_index(sock_net(skb->sk), ifidx); if (!netdev) { - mutex_unlock(&cfg80211_mutex); + rtnl_unlock(); + kfree(tb); return -ENODEV; } if (netdev->ieee80211_ptr) {