From 015f6a5a0cd1c8b0d40441b9fd9e4c8658bc9493 Mon Sep 17 00:00:00 2001 From: Jintao Lin Date: Fri, 9 Aug 2024 18:10:34 +0000 Subject: [PATCH] nl80211: NULL pointer check for link before use 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 --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a71fbf8b1..cfca5b9f9 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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)",