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
1 changed files with 3 additions and 2 deletions
|
@ -1816,8 +1816,6 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname,
|
|||
if (drv == NULL)
|
||||
return NULL;
|
||||
drv->global = global_priv;
|
||||
if (drv->global)
|
||||
dl_list_add(&drv->global->interfaces, &drv->list);
|
||||
drv->ctx = ctx;
|
||||
bss = &drv->first_bss;
|
||||
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))
|
||||
goto failed;
|
||||
|
||||
if (drv->global)
|
||||
dl_list_add(&drv->global->interfaces, &drv->list);
|
||||
|
||||
return bss;
|
||||
|
||||
failed:
|
||||
|
|
Loading…
Reference in a new issue