History

Merge tag 'mac80211-for-davem-2018-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says: ==================== A handful of fixes: * hwsim radio dump wasn't working for the first radio * mesh was updating statistics incorrectly * a netlink message allocation was possibly too short * wiphy name limit was still too long * in certain cases regdb query could find a NULL pointer ====================

David S. Miller committed 8 years ago

Commit 419fc882 parents d7db318 fed48255 files · +12 −8Browse files

Unified · Split

5 files
  1. drivers/net/wireless/mac80211_hwsim.c +2 −2
  2. include/uapi/linux/nl80211.h +1 −1
  3. net/mac80211/mesh_plink.c +4 −4
  4. net/wireless/nl80211.c +2 −1
  5. net/wireless/reg.c +3 −0
drivers/net/wireless/mac80211_hwsim.c+2−2
@@ -3340,7 +3340,7 @@ out_err: · 3339 unmodified lines
33403340 static int hwsim_dump_radio_nl(struct sk_buff *skb,
33413341 struct netlink_callback *cb)
33423342 {
3343− int last_idx = cb->args[0];
3343+ int last_idx = cb->args[0] - 1;
33443344 struct mac80211_hwsim_data *data = NULL;
33453345 int res = 0;
33463346 void *hdr;
@@ -3368,7 +3368,7 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb, · 21 unmodified lines
33683368 last_idx = data->idx;
33693369 }
33703370
3371− cb->args[0] = last_idx;
3371+ cb->args[0] = last_idx + 1;
33723372
33733373 /* list changed, but no new element sent, set interrupted flag */
33743374 if (skb->len == 0 && cb->prev_seq && cb->seq != cb->prev_seq) {
include/uapi/linux/nl80211.h+1−1
@@ -2698,7 +2698,7 @@ enum nl80211_attrs { · 2697 unmodified lines
26982698 #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
26992699 #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
27002700
2701−#define NL80211_WIPHY_NAME_MAXLEN 128
2701+#define NL80211_WIPHY_NAME_MAXLEN 64
27022702
27032703 #define NL80211_MAX_SUPP_RATES 32
27042704 #define NL80211_MAX_SUPP_HT_RATES 77
net/mac80211/mesh_plink.c+4−4
@@ -401,7 +401,7 @@ u32 mesh_plink_deactivate(struct sta_info *sta) · 400 unmodified lines
401401
402402 static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
403403 struct sta_info *sta,
404− struct ieee802_11_elems *elems, bool insert)
404+ struct ieee802_11_elems *elems)
405405 {
406406 struct ieee80211_local *local = sdata->local;
407407 struct ieee80211_supported_band *sband;
@@ -447,7 +447,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, · 39 unmodified lines
447447 sta->sta.bandwidth = IEEE80211_STA_RX_BW_20;
448448 }
449449
450− if (insert)
450+ if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
451451 rate_control_rate_init(sta);
452452 else
453453 rate_control_rate_update(local, sband, sta, changed);
@@ -551,7 +551,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, · 97 unmodified lines
551551 rcu_read_lock();
552552 sta = sta_info_get(sdata, addr);
553553 if (sta) {
554− mesh_sta_info_init(sdata, sta, elems, false);
554+ mesh_sta_info_init(sdata, sta, elems);
555555 } else {
556556 rcu_read_unlock();
557557 /* can't run atomic */
@@ -561,7 +561,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines
561561 return NULL;
562562 }
563563
564− mesh_sta_info_init(sdata, sta, elems, true);
564+ mesh_sta_info_init(sdata, sta, elems);
565565
566566 if (sta_info_insert_rcu(sta))
567567 return NULL;
net/wireless/nl80211.c+2−1
@@ -15555,7 +15555,8 @@ void cfg80211_ft_event(struct net_device *netdev, · 15554 unmodified lines
1555515555 if (!ft_event->target_ap)
1555615556 return;
1555715557
15558− msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL);
15558+ msg = nlmsg_new(100 + ft_event->ies_len + ft_event->ric_ies_len,
15559+ GFP_KERNEL);
1555915560 if (!msg)
1556015561 return;
1556115562
net/wireless/reg.c+3−0
@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr, · 915 unmodified lines
916916 const struct fwdb_header *hdr = regdb;
917917 const struct fwdb_country *country;
918918
919+ if (!regdb)
920+ return -ENODATA;
921+
919922 if (IS_ERR(regdb))
920923 return PTR_ERR(regdb);
921924