]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Remove nl_msg free on send failure for NAN USD commands
authorShivani Baranwal <quic_shivbara@quicinc.com>
Thu, 12 Sep 2024 12:19:03 +0000 (17:49 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 12 Sep 2024 18:39:08 +0000 (21:39 +0300)
Remove nl_msg_free() after send failure for NAN USD commands. Freeing
the nl_msg is already taken care as part of send_and_recv_cmd() for both
success and failure cases.

Fixes: 58f04221fdef ("nl80211: NAN USD commands for offloading")
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
src/drivers/driver_nl80211.c

index 5c2a721d11bdea26049b28183120974a756e4456..1356d325d5e751dd90977ba30bd752532254cc37 100644 (file)
@@ -13618,12 +13618,10 @@ static int nl80211_nan_flush(void *priv)
        nla_nest_end(msg, container);
 
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD flush");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);
@@ -13687,12 +13685,10 @@ static int nl80211_nan_publish(void *priv, const u8 *src, int publish_id,
 
        nla_nest_end(msg, container);
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD publish");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);
@@ -13730,12 +13726,10 @@ static int nl80211_nan_cancel_publish(void *priv, int publish_id)
        nla_nest_end(msg, container);
 
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD cancel publish");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);
@@ -13776,12 +13770,10 @@ static int nl80211_nan_update_publish(void *priv, int publish_id,
 
        nla_nest_end(msg, container);
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD update publish");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);
@@ -13845,12 +13837,10 @@ static int nl80211_nan_subscribe(void *priv, const u8 *src, int subscribe_id,
 
        nla_nest_end(msg, container);
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD subscribe");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);
@@ -13886,12 +13876,10 @@ static int nl80211_nan_cancel_subscribe(void *priv, int subscribe_id)
        nla_nest_end(msg, container);
 
        ret = send_and_recv_cmd(drv, msg);
-       if (ret) {
+       if (ret)
                wpa_printf(MSG_ERROR,
                           "nl80211: Failed to send NAN USD cancel subscribe");
-               goto fail;
-       }
-       return 0;
+       return ret;
 
 fail:
        nlmsg_free(msg);