diff options
| -rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 5 | ||||
| -rw-r--r-- | drivers/net/wireless/virt_wifi.c | 4 | ||||
| -rw-r--r-- | net/mac80211/cfg.c | 4 | ||||
| -rw-r--r-- | net/mac80211/rx.c | 6 | ||||
| -rw-r--r-- | net/wireless/nl80211.c | 2 | ||||
| -rw-r--r-- | net/wireless/reg.c | 13 |
6 files changed, 26 insertions, 8 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 3a4b8786f7ea..320edcac4699 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -2761,6 +2761,11 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, | |||
| 2761 | BIT(NL80211_CHAN_WIDTH_160); | 2761 | BIT(NL80211_CHAN_WIDTH_160); |
| 2762 | } | 2762 | } |
| 2763 | 2763 | ||
| 2764 | if (!n_limits) { | ||
| 2765 | err = -EINVAL; | ||
| 2766 | goto failed_hw; | ||
| 2767 | } | ||
| 2768 | |||
| 2764 | data->if_combination.n_limits = n_limits; | 2769 | data->if_combination.n_limits = n_limits; |
| 2765 | data->if_combination.max_interfaces = 2048; | 2770 | data->if_combination.max_interfaces = 2048; |
| 2766 | data->if_combination.limits = data->if_limits; | 2771 | data->if_combination.limits = data->if_limits; |
diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c index 64b218699656..3a93e4d9828b 100644 --- a/drivers/net/wireless/virt_wifi.c +++ b/drivers/net/wireless/virt_wifi.c | |||
| @@ -530,8 +530,10 @@ static int virt_wifi_newlink(struct net *src_net, struct net_device *dev, | |||
| 530 | SET_NETDEV_DEV(dev, &priv->lowerdev->dev); | 530 | SET_NETDEV_DEV(dev, &priv->lowerdev->dev); |
| 531 | dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL); | 531 | dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL); |
| 532 | 532 | ||
| 533 | if (!dev->ieee80211_ptr) | 533 | if (!dev->ieee80211_ptr) { |
| 534 | err = -ENOMEM; | ||
| 534 | goto remove_handler; | 535 | goto remove_handler; |
| 536 | } | ||
| 535 | 537 | ||
| 536 | dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION; | 538 | dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION; |
| 537 | dev->ieee80211_ptr->wiphy = common_wiphy; | 539 | dev->ieee80211_ptr->wiphy = common_wiphy; |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index de65fe3ed9cc..2493c74c2d37 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -1490,6 +1490,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
| 1490 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) | 1490 | if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) |
| 1491 | sta->sta.tdls = true; | 1491 | sta->sta.tdls = true; |
| 1492 | 1492 | ||
| 1493 | if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && | ||
| 1494 | !sdata->u.mgd.associated) | ||
| 1495 | return -EINVAL; | ||
| 1496 | |||
| 1493 | err = sta_apply_parameters(local, sta, params); | 1497 | err = sta_apply_parameters(local, sta, params); |
| 1494 | if (err) { | 1498 | if (err) { |
| 1495 | sta_info_free(local, sta); | 1499 | sta_info_free(local, sta); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 45aad3d3108c..bb4d71efb6fb 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -231,7 +231,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata, | |||
| 231 | struct ieee80211_hdr_3addr hdr; | 231 | struct ieee80211_hdr_3addr hdr; |
| 232 | u8 category; | 232 | u8 category; |
| 233 | u8 action_code; | 233 | u8 action_code; |
| 234 | } __packed action; | 234 | } __packed __aligned(2) action; |
| 235 | 235 | ||
| 236 | if (!sdata) | 236 | if (!sdata) |
| 237 | return; | 237 | return; |
| @@ -2723,7 +2723,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
| 2723 | skb_set_queue_mapping(skb, q); | 2723 | skb_set_queue_mapping(skb, q); |
| 2724 | 2724 | ||
| 2725 | if (!--mesh_hdr->ttl) { | 2725 | if (!--mesh_hdr->ttl) { |
| 2726 | IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); | 2726 | if (!is_multicast_ether_addr(hdr->addr1)) |
| 2727 | IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, | ||
| 2728 | dropped_frames_ttl); | ||
| 2727 | goto out; | 2729 | goto out; |
| 2728 | } | 2730 | } |
| 2729 | 2731 | ||
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5e49492d5911..74150ad95823 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -555,7 +555,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | |||
| 555 | }, | 555 | }, |
| 556 | [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1), | 556 | [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1), |
| 557 | [NL80211_ATTR_PEER_MEASUREMENTS] = | 557 | [NL80211_ATTR_PEER_MEASUREMENTS] = |
| 558 | NLA_POLICY_NESTED(NL80211_PMSR_FTM_REQ_ATTR_MAX, | 558 | NLA_POLICY_NESTED(NL80211_PMSR_ATTR_MAX, |
| 559 | nl80211_pmsr_attr_policy), | 559 | nl80211_pmsr_attr_policy), |
| 560 | }; | 560 | }; |
| 561 | 561 | ||
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index ecfb1a06dbb2..dd58b9909ac9 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
| @@ -1024,8 +1024,13 @@ static void regdb_fw_cb(const struct firmware *fw, void *context) | |||
| 1024 | } | 1024 | } |
| 1025 | 1025 | ||
| 1026 | rtnl_lock(); | 1026 | rtnl_lock(); |
| 1027 | if (WARN_ON(regdb && !IS_ERR(regdb))) { | 1027 | if (regdb && !IS_ERR(regdb)) { |
| 1028 | /* just restore and free new db */ | 1028 | /* negative case - a bug |
| 1029 | * positive case - can happen due to race in case of multiple cb's in | ||
| 1030 | * queue, due to usage of asynchronous callback | ||
| 1031 | * | ||
| 1032 | * Either case, just restore and free new db. | ||
| 1033 | */ | ||
| 1029 | } else if (set_error) { | 1034 | } else if (set_error) { |
| 1030 | regdb = ERR_PTR(set_error); | 1035 | regdb = ERR_PTR(set_error); |
| 1031 | } else if (fw) { | 1036 | } else if (fw) { |
| @@ -1255,7 +1260,7 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd) | |||
| 1255 | * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), | 1260 | * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), |
| 1256 | * however it is safe for now to assume that a frequency rule should not be | 1261 | * however it is safe for now to assume that a frequency rule should not be |
| 1257 | * part of a frequency's band if the start freq or end freq are off by more | 1262 | * part of a frequency's band if the start freq or end freq are off by more |
| 1258 | * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the | 1263 | * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the |
| 1259 | * 60 GHz band. | 1264 | * 60 GHz band. |
| 1260 | * This resolution can be lowered and should be considered as we add | 1265 | * This resolution can be lowered and should be considered as we add |
| 1261 | * regulatory rule support for other "bands". | 1266 | * regulatory rule support for other "bands". |
| @@ -1270,7 +1275,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range, | |||
| 1270 | * with the Channel starting frequency above 45 GHz. | 1275 | * with the Channel starting frequency above 45 GHz. |
| 1271 | */ | 1276 | */ |
| 1272 | u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? | 1277 | u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? |
| 1273 | 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; | 1278 | 20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; |
| 1274 | if (abs(freq_khz - freq_range->start_freq_khz) <= limit) | 1279 | if (abs(freq_khz - freq_range->start_freq_khz) <= limit) |
| 1275 | return true; | 1280 | return true; |
| 1276 | if (abs(freq_khz - freq_range->end_freq_khz) <= limit) | 1281 | if (abs(freq_khz - freq_range->end_freq_khz) <= limit) |
