]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix AP deinit path in error cases
authorJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 08:57:04 +0000 (10:57 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 09:13:25 +0000 (11:13 +0200)
If the interface initialization fails, no links might be set when
calling the deinit functions. Those functions need to be prepared for
bss->flink being NULL.

Fixes: 47269be36e61 ("nl80211: Refactor i802_bss to support multiple links")
Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_nl80211.c

index dbe092adfbad7195462e3e288b5323d8651e249f..4bebd6ed3f8cd90c2f7880b1ed563b166f16c50b 100644 (file)
@@ -6135,7 +6135,8 @@ static void nl80211_teardown_ap(struct i802_bss *bss)
                nl80211_mgmt_unsubscribe(bss, "AP teardown");
 
        nl80211_put_wiphy_data_ap(bss);
-       bss->flink->beacon_set = 0;
+       if (bss->flink)
+               bss->flink->beacon_set = 0;
 }