Skip to content

Commit 419fc88

Browse files
committed
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 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents d7db318 + fed4825 commit 419fc88

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎drivers/net/wireless/mac80211_hwsim.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,7 +3340,7 @@ static int hwsim_get_radio_nl(struct sk_buff *msg, struct genl_info *info)
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,
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‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2698,7 +2698,7 @@ enum nl80211_attrs {
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‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ u32 mesh_plink_deactivate(struct sta_info *sta)
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,
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,
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,
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‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15555,7 +15555,8 @@ void cfg80211_ft_event(struct net_device *netdev,
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‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr,
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

0 commit comments

Comments
 (0)