nl80211: Verify that nla_put_flag() succeeds for background radar

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-05-08 00:29:48 +03:00
parent 993eb12407
commit a8c3199527

View file

@ -4993,8 +4993,9 @@ static int nl80211_put_freq_params(struct nl_msg *msg,
NL80211_CHAN_NO_HT))
return -ENOBUFS;
}
if (freq->radar_background)
nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND);
if (freq->radar_background &&
nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND))
return -ENOBUFS;
return 0;
}