mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-21 03:23:04 -05:00
nl80211: Do not add interface to the global list in case of failure
This avoids leaving a freed interface on the global list in case driver initialization fails.
This commit is contained in:
parent
cd9fc7869a
commit
c4bb881743
@ -1816,8 +1816,6 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname,
|
|||||||
if (drv == NULL)
|
if (drv == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
drv->global = global_priv;
|
drv->global = global_priv;
|
||||||
if (drv->global)
|
|
||||||
dl_list_add(&drv->global->interfaces, &drv->list);
|
|
||||||
drv->ctx = ctx;
|
drv->ctx = ctx;
|
||||||
bss = &drv->first_bss;
|
bss = &drv->first_bss;
|
||||||
bss->drv = drv;
|
bss->drv = drv;
|
||||||
@ -1867,6 +1865,9 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname,
|
|||||||
if (wpa_driver_nl80211_finish_drv_init(drv))
|
if (wpa_driver_nl80211_finish_drv_init(drv))
|
||||||
goto failed;
|
goto failed;
|
||||||
|
|
||||||
|
if (drv->global)
|
||||||
|
dl_list_add(&drv->global->interfaces, &drv->list);
|
||||||
|
|
||||||
return bss;
|
return bss;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user