]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP MLD: Remove unnecessary wpa_group get and put for ML cases
authorAdil Saeed Musthafa <quic_adilm@quicinc.com>
Thu, 21 Nov 2024 08:02:25 +0000 (00:02 -0800)
committerJouni Malinen <j@w1.fi>
Wed, 27 Nov 2024 17:17:33 +0000 (19:17 +0200)
Remove unnecessary wpa_group_get() and wpa_group_put() calls where the
arguments are ML wpa_auth and wpa_auth->group, which are bound to be
no-op since such cases are not icluded in the references counter.

In practice, this reverts the third item listed in the commit message
for commit 3ea7cf11db4a ("AP MLD: Enhance authenticator state machine").

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
src/ap/wpa_auth.c

index 5de4e09b7ffaff948c64734ee621b50bf8a4152a..5432e1541be7186a7ed87436fcf4f9f89fa27560 100644 (file)
@@ -133,11 +133,8 @@ void wpa_release_link_auth_ref(struct wpa_state_machine *sm,
                return;
 
        for_each_sm_auth(sm, link_id) {
-               if (link_id == release_link_id) {
-                       wpa_group_put(sm->mld_links[link_id].wpa_auth,
-                                     sm->mld_links[link_id].wpa_auth->group);
+               if (link_id == release_link_id)
                        sm->mld_links[link_id].wpa_auth = NULL;
-               }
        }
 }
 
@@ -1045,11 +1042,8 @@ static void wpa_free_sta_sm(struct wpa_state_machine *sm)
        os_free(sm->rsnxe);
        os_free(sm->rsn_selection);
 #ifdef CONFIG_IEEE80211BE
-       for_each_sm_auth(sm, link_id) {
-               wpa_group_put(sm->mld_links[link_id].wpa_auth,
-                             sm->mld_links[link_id].wpa_auth->group);
+       for_each_sm_auth(sm, link_id)
                sm->mld_links[link_id].wpa_auth = NULL;
-       }
 #endif /* CONFIG_IEEE80211BE */
        wpa_group_put(sm->wpa_auth, sm->group);
 #ifdef CONFIG_DPP2
@@ -7462,11 +7456,8 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm,
                        ctx.wpa_auth = NULL;
                        wpa_auth_for_each_auth(sm->wpa_auth,
                                               wpa_get_link_sta_auth, &ctx);
-                       if (ctx.wpa_auth) {
+                       if (ctx.wpa_auth)
                                sm_link->wpa_auth = ctx.wpa_auth;
-                               wpa_group_get(sm_link->wpa_auth,
-                                             sm_link->wpa_auth->group);
-                       }
                } else {
                        sm_link->wpa_auth = sm->wpa_auth;
                }