From: Jouni Malinen Date: Sat, 7 May 2022 21:29:48 +0000 (+0300) Subject: nl80211: Verify that nla_put_flag() succeeds for background radar X-Git-Tag: hostap_2_11~1924 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8c3199527981668c89ac648791214b36f2f0fc8;p=thirdparty%2Fhostap.git nl80211: Verify that nla_put_flag() succeeds for background radar Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index fa89a006b..0127a6be2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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; }