driver_nl80211.c assumes that global driver pointer is set, so better
make this more consistent.
Signed-hostap: Jouni Malinen <j@w1.fi>
struct rfkill_config *rcfg;
struct i802_bss *bss;
+ if (global_priv == NULL)
+ return NULL;
drv = os_zalloc(sizeof(*drv));
if (drv == NULL)
return NULL;
* dynamically added interface (e.g., P2P) that was already configured
* with proper iftype.
*/
- if ((drv->global == NULL ||
- drv->ifindex != drv->global->if_add_ifindex) &&
+ if (drv->ifindex != drv->global->if_add_ifindex &&
wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
"use managed mode");