Commit 419fc888 authored by David S. Miller's avatar David S. Miller

Merge tag 'mac80211-for-davem-2018-05-23' of...

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: default avatarDavid S. Miller <davem@davemloft.net>
parents d7db3186 fed48250
...@@ -3340,7 +3340,7 @@ static int hwsim_get_radio_nl(struct sk_buff *msg, struct genl_info *info) ...@@ -3340,7 +3340,7 @@ static int hwsim_get_radio_nl(struct sk_buff *msg, struct genl_info *info)
static int hwsim_dump_radio_nl(struct sk_buff *skb, static int hwsim_dump_radio_nl(struct sk_buff *skb,
struct netlink_callback *cb) struct netlink_callback *cb)
{ {
int last_idx = cb->args[0]; int last_idx = cb->args[0] - 1;
struct mac80211_hwsim_data *data = NULL; struct mac80211_hwsim_data *data = NULL;
int res = 0; int res = 0;
void *hdr; void *hdr;
...@@ -3368,7 +3368,7 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb, ...@@ -3368,7 +3368,7 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb,
last_idx = data->idx; last_idx = data->idx;
} }
cb->args[0] = last_idx; cb->args[0] = last_idx + 1;
/* list changed, but no new element sent, set interrupted flag */ /* list changed, but no new element sent, set interrupted flag */
if (skb->len == 0 && cb->prev_seq && cb->seq != cb->prev_seq) { if (skb->len == 0 && cb->prev_seq && cb->seq != cb->prev_seq) {
......
...@@ -2698,7 +2698,7 @@ enum nl80211_attrs { ...@@ -2698,7 +2698,7 @@ enum nl80211_attrs {
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
#define NL80211_WIPHY_NAME_MAXLEN 128 #define NL80211_WIPHY_NAME_MAXLEN 64
#define NL80211_MAX_SUPP_RATES 32 #define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_HT_RATES 77 #define NL80211_MAX_SUPP_HT_RATES 77
......
...@@ -401,7 +401,7 @@ u32 mesh_plink_deactivate(struct sta_info *sta) ...@@ -401,7 +401,7 @@ u32 mesh_plink_deactivate(struct sta_info *sta)
static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, struct sta_info *sta,
struct ieee802_11_elems *elems, bool insert) struct ieee802_11_elems *elems)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
...@@ -447,7 +447,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, ...@@ -447,7 +447,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
sta->sta.bandwidth = IEEE80211_STA_RX_BW_20; sta->sta.bandwidth = IEEE80211_STA_RX_BW_20;
} }
if (insert) if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL))
rate_control_rate_init(sta); rate_control_rate_init(sta);
else else
rate_control_rate_update(local, sband, sta, changed); rate_control_rate_update(local, sband, sta, changed);
...@@ -551,7 +551,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, ...@@ -551,7 +551,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata,
rcu_read_lock(); rcu_read_lock();
sta = sta_info_get(sdata, addr); sta = sta_info_get(sdata, addr);
if (sta) { if (sta) {
mesh_sta_info_init(sdata, sta, elems, false); mesh_sta_info_init(sdata, sta, elems);
} else { } else {
rcu_read_unlock(); rcu_read_unlock();
/* can't run atomic */ /* can't run atomic */
...@@ -561,7 +561,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, ...@@ -561,7 +561,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata,
return NULL; return NULL;
} }
mesh_sta_info_init(sdata, sta, elems, true); mesh_sta_info_init(sdata, sta, elems);
if (sta_info_insert_rcu(sta)) if (sta_info_insert_rcu(sta))
return NULL; return NULL;
......
...@@ -15555,7 +15555,8 @@ void cfg80211_ft_event(struct net_device *netdev, ...@@ -15555,7 +15555,8 @@ void cfg80211_ft_event(struct net_device *netdev,
if (!ft_event->target_ap) if (!ft_event->target_ap)
return; return;
msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL); msg = nlmsg_new(100 + ft_event->ies_len + ft_event->ric_ies_len,
GFP_KERNEL);
if (!msg) if (!msg)
return; return;
......
...@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr, ...@@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr,
const struct fwdb_header *hdr = regdb; const struct fwdb_header *hdr = regdb;
const struct fwdb_country *country; const struct fwdb_country *country;
if (!regdb)
return -ENODATA;
if (IS_ERR(regdb)) if (IS_ERR(regdb))
return PTR_ERR(regdb); return PTR_ERR(regdb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment