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 ====================
Unified · Split
| @@ -3340,7 +3340,7 @@ out_err: · 3339 unmodified lines | ||
| 3340 | 3340 | static int hwsim_dump_radio_nl(struct sk_buff *skb, |
| 3341 | 3341 | struct netlink_callback *cb) |
| 3342 | 3342 | { |
| 3343 | − int last_idx = cb->args[0]; | |
| 3343 | + int last_idx = cb->args[0] - 1; | |
| 3344 | 3344 | struct mac80211_hwsim_data *data = NULL; |
| 3345 | 3345 | int res = 0; |
| 3346 | 3346 | void *hdr; |
| @@ -3368,7 +3368,7 @@ static int hwsim_dump_radio_nl(struct sk_buff *skb, · 21 unmodified lines | ||
| 3368 | 3368 | last_idx = data->idx; |
| 3369 | 3369 | } |
| 3370 | 3370 | |
| 3371 | − cb->args[0] = last_idx; | |
| 3371 | + cb->args[0] = last_idx + 1; | |
| 3372 | 3372 | |
| 3373 | 3373 | /* list changed, but no new element sent, set interrupted flag */ |
| 3374 | 3374 | if (skb->len == 0 && cb->prev_seq && cb->seq != cb->prev_seq) { |
| @@ -2698,7 +2698,7 @@ enum nl80211_attrs { · 2697 unmodified lines | ||
| 2698 | 2698 | #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS |
| 2699 | 2699 | #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS |
| 2700 | 2700 | |
| 2701 | −#define NL80211_WIPHY_NAME_MAXLEN 128 | |
| 2701 | +#define NL80211_WIPHY_NAME_MAXLEN 64 | |
| 2702 | 2702 | |
| 2703 | 2703 | #define NL80211_MAX_SUPP_RATES 32 |
| 2704 | 2704 | #define NL80211_MAX_SUPP_HT_RATES 77 |
| @@ -401,7 +401,7 @@ u32 mesh_plink_deactivate(struct sta_info *sta) · 400 unmodified lines | ||
| 401 | 401 | |
| 402 | 402 | static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, |
| 403 | 403 | struct sta_info *sta, |
| 404 | − struct ieee802_11_elems *elems, bool insert) | |
| 404 | + struct ieee802_11_elems *elems) | |
| 405 | 405 | { |
| 406 | 406 | struct ieee80211_local *local = sdata->local; |
| 407 | 407 | struct ieee80211_supported_band *sband; |
| @@ -447,7 +447,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, · 39 unmodified lines | ||
| 447 | 447 | sta->sta.bandwidth = IEEE80211_STA_RX_BW_20; |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | − if (insert) | |
| 450 | + if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) | |
| 451 | 451 | rate_control_rate_init(sta); |
| 452 | 452 | else |
| 453 | 453 | 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 | ||
| 551 | 551 | rcu_read_lock(); |
| 552 | 552 | sta = sta_info_get(sdata, addr); |
| 553 | 553 | if (sta) { |
| 554 | − mesh_sta_info_init(sdata, sta, elems, false); | |
| 554 | + mesh_sta_info_init(sdata, sta, elems); | |
| 555 | 555 | } else { |
| 556 | 556 | rcu_read_unlock(); |
| 557 | 557 | /* can't run atomic */ |
| @@ -561,7 +561,7 @@ mesh_sta_info_get(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines | ||
| 561 | 561 | return NULL; |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | − mesh_sta_info_init(sdata, sta, elems, true); | |
| 564 | + mesh_sta_info_init(sdata, sta, elems); | |
| 565 | 565 | |
| 566 | 566 | if (sta_info_insert_rcu(sta)) |
| 567 | 567 | return NULL; |
| @@ -15555,7 +15555,8 @@ void cfg80211_ft_event(struct net_device *netdev, · 15554 unmodified lines | ||
| 15555 | 15555 | if (!ft_event->target_ap) |
| 15556 | 15556 | return; |
| 15557 | 15557 | |
| 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); | |
| 15559 | 15560 | if (!msg) |
| 15560 | 15561 | return; |
| 15561 | 15562 | |
| @@ -916,6 +916,9 @@ int reg_query_regdb_wmm(char *alpha2, int freq, u32 *dbptr, · 915 unmodified lines | ||
| 916 | 916 | const struct fwdb_header *hdr = regdb; |
| 917 | 917 | const struct fwdb_country *country; |
| 918 | 918 | |
| 919 | + if (!regdb) | |
| 920 | + return -ENODATA; | |
| 921 | + | |
| 919 | 922 | if (IS_ERR(regdb)) |
| 920 | 923 | return PTR_ERR(regdb); |
| 921 | 924 | |