Commit 53b18980 authored by Johannes Berg's avatar Johannes Berg

nl80211: always check nla_put* return values

A few instances were found where we didn't check them, add the
missing checks even though they'll probably never trigger as
the message should be large enough here.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 76e1fb4b
...@@ -9453,8 +9453,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg, ...@@ -9453,8 +9453,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
if (!freqs) if (!freqs)
return -ENOBUFS; return -ENOBUFS;
for (i = 0; i < req->n_channels; i++) for (i = 0; i < req->n_channels; i++) {
nla_put_u32(msg, i, req->channels[i]->center_freq); if (nla_put_u32(msg, i, req->channels[i]->center_freq))
return -ENOBUFS;
}
nla_nest_end(msg, freqs); nla_nest_end(msg, freqs);
...@@ -9468,9 +9470,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg, ...@@ -9468,9 +9470,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg,
if (!match) if (!match)
return -ENOBUFS; return -ENOBUFS;
nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, if (nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
req->match_sets[i].ssid.ssid_len, req->match_sets[i].ssid.ssid_len,
req->match_sets[i].ssid.ssid); req->match_sets[i].ssid.ssid))
return -ENOBUFS;
nla_nest_end(msg, match); nla_nest_end(msg, match);
} }
nla_nest_end(msg, matches); nla_nest_end(msg, matches);
......
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