diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2016-09-14 03:59:21 -0400 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2016-09-15 10:46:17 -0400 |
| commit | 53b18980fded52e39520661af3528577d36eb279 (patch) | |
| tree | 817a838980a375f33e0179353aed39da0ca725b3 /net/wireless | |
| parent | 76e1fb4b5532a9df9eb14cfe002412c7617c4ad0 (diff) | |
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: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
| -rw-r--r-- | net/wireless/nl80211.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 60c8a7429d33..887c4c114206 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -9453,8 +9453,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg, | |||
| 9453 | if (!freqs) | 9453 | if (!freqs) |
| 9454 | return -ENOBUFS; | 9454 | return -ENOBUFS; |
| 9455 | 9455 | ||
| 9456 | for (i = 0; i < req->n_channels; i++) | 9456 | for (i = 0; i < req->n_channels; i++) { |
| 9457 | nla_put_u32(msg, i, req->channels[i]->center_freq); | 9457 | if (nla_put_u32(msg, i, req->channels[i]->center_freq)) |
| 9458 | return -ENOBUFS; | ||
| 9459 | } | ||
| 9458 | 9460 | ||
| 9459 | nla_nest_end(msg, freqs); | 9461 | nla_nest_end(msg, freqs); |
| 9460 | 9462 | ||
| @@ -9468,9 +9470,10 @@ static int nl80211_send_wowlan_nd(struct sk_buff *msg, | |||
| 9468 | if (!match) | 9470 | if (!match) |
| 9469 | return -ENOBUFS; | 9471 | return -ENOBUFS; |
| 9470 | 9472 | ||
| 9471 | nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, | 9473 | if (nla_put(msg, NL80211_SCHED_SCAN_MATCH_ATTR_SSID, |
| 9472 | req->match_sets[i].ssid.ssid_len, | 9474 | req->match_sets[i].ssid.ssid_len, |
| 9473 | req->match_sets[i].ssid.ssid); | 9475 | req->match_sets[i].ssid.ssid)) |
| 9476 | return -ENOBUFS; | ||
| 9474 | nla_nest_end(msg, match); | 9477 | nla_nest_end(msg, match); |
| 9475 | } | 9478 | } |
| 9476 | nla_nest_end(msg, matches); | 9479 | nla_nest_end(msg, matches); |
