aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c60
1 files changed, 37 insertions, 23 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a1eb21073176..138dc3bb8b67 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2687,7 +2687,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
2687 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, 2687 hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
2688 NL80211_CMD_NEW_KEY); 2688 NL80211_CMD_NEW_KEY);
2689 if (!hdr) 2689 if (!hdr)
2690 return -ENOBUFS; 2690 goto nla_put_failure;
2691 2691
2692 cookie.msg = msg; 2692 cookie.msg = msg;
2693 cookie.idx = key_idx; 2693 cookie.idx = key_idx;
@@ -5349,6 +5349,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
5349 err = -EINVAL; 5349 err = -EINVAL;
5350 goto out_free; 5350 goto out_free;
5351 } 5351 }
5352
5353 if (!wiphy->bands[band])
5354 continue;
5355
5352 err = ieee80211_get_ratemask(wiphy->bands[band], 5356 err = ieee80211_get_ratemask(wiphy->bands[band],
5353 nla_data(attr), 5357 nla_data(attr),
5354 nla_len(attr), 5358 nla_len(attr),
@@ -9633,8 +9637,9 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
9633 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) 9637 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie))
9634 goto nla_put_failure; 9638 goto nla_put_failure;
9635 9639
9636 if (req->flags) 9640 if (req->flags &&
9637 nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags); 9641 nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags))
9642 goto nla_put_failure;
9638 9643
9639 return 0; 9644 return 0;
9640 nla_put_failure: 9645 nla_put_failure:
@@ -11093,6 +11098,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
11093 struct nlattr *reasons; 11098 struct nlattr *reasons;
11094 11099
11095 reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); 11100 reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS);
11101 if (!reasons)
11102 goto free_msg;
11096 11103
11097 if (wakeup->disconnect && 11104 if (wakeup->disconnect &&
11098 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) 11105 nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT))
@@ -11118,16 +11125,18 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
11118 wakeup->pattern_idx)) 11125 wakeup->pattern_idx))
11119 goto free_msg; 11126 goto free_msg;
11120 11127
11121 if (wakeup->tcp_match) 11128 if (wakeup->tcp_match &&
11122 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH); 11129 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH))
11130 goto free_msg;
11123 11131
11124 if (wakeup->tcp_connlost) 11132 if (wakeup->tcp_connlost &&
11125 nla_put_flag(msg, 11133 nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST))
11126 NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST); 11134 goto free_msg;
11127 11135
11128 if (wakeup->tcp_nomoretokens) 11136 if (wakeup->tcp_nomoretokens &&
11129 nla_put_flag(msg, 11137 nla_put_flag(msg,
11130 NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS); 11138 NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS))
11139 goto free_msg;
11131 11140
11132 if (wakeup->packet) { 11141 if (wakeup->packet) {
11133 u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; 11142 u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211;
@@ -11263,24 +11272,29 @@ void cfg80211_ft_event(struct net_device *netdev,
11263 return; 11272 return;
11264 11273
11265 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); 11274 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT);
11266 if (!hdr) { 11275 if (!hdr)
11267 nlmsg_free(msg); 11276 goto out;
11268 return;
11269 }
11270 11277
11271 nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); 11278 if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
11272 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); 11279 nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) ||
11273 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap); 11280 nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap))
11274 if (ft_event->ies) 11281 goto out;
11275 nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies); 11282
11276 if (ft_event->ric_ies) 11283 if (ft_event->ies &&
11277 nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, 11284 nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies))
11278 ft_event->ric_ies); 11285 goto out;
11286 if (ft_event->ric_ies &&
11287 nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len,
11288 ft_event->ric_ies))
11289 goto out;
11279 11290
11280 genlmsg_end(msg, hdr); 11291 genlmsg_end(msg, hdr);
11281 11292
11282 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, 11293 genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
11283 NL80211_MCGRP_MLME, GFP_KERNEL); 11294 NL80211_MCGRP_MLME, GFP_KERNEL);
11295 return;
11296 out:
11297 nlmsg_free(msg);
11284} 11298}
11285EXPORT_SYMBOL(cfg80211_ft_event); 11299EXPORT_SYMBOL(cfg80211_ft_event);
11286 11300