From: Jouni Malinen Date: Mon, 7 Nov 2022 10:27:25 +0000 (+0200) Subject: nl80211: Check that attribute addition succeeds in offloaded PASN case X-Git-Tag: hostap_2_11~1549 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e1a04afa1f291f0503342d82ccb07b0ee0e6fdc;p=thirdparty%2Fhostap.git nl80211: Check that attribute addition succeeds in offloaded PASN case Check nla_put_flag() return value to be consistent with other nla_put*() uses. Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 399fc2bd0..1b55ceb40 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -12267,9 +12267,10 @@ static int nl80211_send_pasn_resp(void *priv, struct pasn_auth *params) ETH_ALEN, params->peer[i].peer_addr)) goto fail; - if (params->peer[i].status == 0) - nla_put_flag(msg, - QCA_WLAN_VENDOR_ATTR_PASN_PEER_STATUS_SUCCESS); + if (params->peer[i].status == 0 && + nla_put_flag(msg, + QCA_WLAN_VENDOR_ATTR_PASN_PEER_STATUS_SUCCESS)) + goto fail; wpa_printf(MSG_DEBUG, "nl80211: Own address[%u]: " MACSTR