nl80211: Fix AP deinit path (link removal) in error cases

If the interface initialization fails, no links might be set when
calling the deinit functions. Those functions need to be prepared for
bss->n_links being 0.

Fixes: 859cbc396f ("nl80211: Remove links when stopping AP MLD in hostapd")
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2023-12-22 10:57:04 +02:00
parent 6c3438eef6
commit 12a9574342

View file

@ -9372,6 +9372,9 @@ static void nl80211_remove_links(struct i802_bss *bss)
int ret;
u8 link_id;
if (bss->n_links == 0)
return;
while (bss->links[0].link_id != NL80211_DRV_LINK_ID_NA) {
struct i802_link *link = &bss->links[0];