]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Check nla_nest_start() result for NL80211_ATTR_HE_OBSS_PD
authorJouni Malinen <jouni@codeaurora.org>
Mon, 17 Feb 2020 17:30:47 +0000 (19:30 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 17 Feb 2020 17:30:47 +0000 (19:30 +0200)
nla_nest_start() might fail, so need to check its return value similarly
to all the other callers.

Fixes: a84bf443887d ("HE: Send the AP's OBSS PD settings to the kernel")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver_nl80211.c

index 1421aff45354c18b27830175c83a234938d5f7f7..37933ae9ae7e7b3f96c384b227ef460f49b5faa4 100644 (file)
@@ -4353,7 +4353,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                spr = nla_nest_start(msg, NL80211_ATTR_HE_OBSS_PD);
                wpa_printf(MSG_DEBUG, "nl80211: he_spr=%d", params->he_spr);
 
-               if (nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
+               if (!spr ||
+                   nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
                               params->he_spr_srg_obss_pd_min_offset) ||
                    nla_put_u8(msg, NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,
                               params->he_spr_srg_obss_pd_max_offset))