nl80211: Verify that global driver pointer is not NULL
driver_nl80211.c assumes that global driver pointer is set, so better make this more consistent. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
99c01af9aa
commit
a5c696adb4
1 changed files with 3 additions and 2 deletions
|
@ -2278,6 +2278,8 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname,
|
||||||
struct rfkill_config *rcfg;
|
struct rfkill_config *rcfg;
|
||||||
struct i802_bss *bss;
|
struct i802_bss *bss;
|
||||||
|
|
||||||
|
if (global_priv == NULL)
|
||||||
|
return NULL;
|
||||||
drv = os_zalloc(sizeof(*drv));
|
drv = os_zalloc(sizeof(*drv));
|
||||||
if (drv == NULL)
|
if (drv == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2452,8 +2454,7 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
|
||||||
* dynamically added interface (e.g., P2P) that was already configured
|
* dynamically added interface (e.g., P2P) that was already configured
|
||||||
* with proper iftype.
|
* with proper iftype.
|
||||||
*/
|
*/
|
||||||
if ((drv->global == NULL ||
|
if (drv->ifindex != drv->global->if_add_ifindex &&
|
||||||
drv->ifindex != drv->global->if_add_ifindex) &&
|
|
||||||
wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
|
wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
|
||||||
wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
|
wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
|
||||||
"use managed mode");
|
"use managed mode");
|
||||||
|
|
Loading…
Reference in a new issue