]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Free BSS structure even if netdev does not exists
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 22 Oct 2013 10:35:32 +0000 (13:35 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 22 Oct 2013 10:35:32 +0000 (13:35 +0300)
It is possible for a vif netdev to be removed by something else than
hostapd and if that happens for a virtual AP interface, if_remove()
handler should still free the local data structure to avoid memory leaks
if something external removes a netdev.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/drivers/driver_nl80211.c

index e7d3d20d556ee13a4bce2db440abdb919b233435..9539c0fad1a8038fedd1771e74dce75841dece13 100644 (file)
@@ -9251,10 +9251,8 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss,
 
        wpa_printf(MSG_DEBUG, "nl80211: %s(type=%d ifname=%s) ifindex=%d",
                   __func__, type, ifname, ifindex);
-       if (ifindex <= 0)
-               return -1;
-
-       nl80211_remove_iface(drv, ifindex);
+       if (ifindex > 0)
+               nl80211_remove_iface(drv, ifindex);
 
 #ifdef HOSTAPD
        if (type != WPA_IF_AP_BSS)