]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: NULL pointer check for link before use
authorJintao Lin <jintaolin@chromium.org>
Fri, 9 Aug 2024 18:10:34 +0000 (18:10 +0000)
committerJouni Malinen <j@w1.fi>
Sat, 10 Aug 2024 08:11:53 +0000 (11:11 +0300)
bss->flink could be NULL when wpa_driver_nl80211_del_beacon() is called
if wpa_driver_nl80211_drv_init() fails early through the 'failed' label
and jumps to wpa_driver_nl80211_deinit() with bss->flink unset.

Fixes: 47269be36e61 ("nl80211: Refactor i802_bss to support multiple links")
Signed-off-by: Jintao Lin <jintaolin@chromium.org>
src/drivers/driver_nl80211.c

index a71fbf8b1f1564ca89c99e2b5cd61a70ef9c52fe..cfca5b9f90ba0c6dd043360ed61d312723a864d7 100644 (file)
@@ -3083,7 +3083,7 @@ static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss,
        struct wpa_driver_nl80211_data *drv = bss->drv;
        struct i802_link *link = nl80211_get_link(bss, link_id);
 
-       if (!link->beacon_set)
+       if (!link || !link->beacon_set)
                return 0;
 
        wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",