]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Check that attribute addition succeeds in offloaded PASN case
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 7 Nov 2022 10:27:25 +0000 (12:27 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 7 Nov 2022 12:02:55 +0000 (14:02 +0200)
Check nla_put_flag() return value to be consistent with other nla_put*()
uses.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/drivers/driver_nl80211.c

index 399fc2bd082ac9e4694491c7705c9048e06c744f..1b55ceb40b05b09939eb0ce4cb7c510c2c6b49bd 100644 (file)
@@ -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