aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-12-02 16:43:09 +0200
committerJouni Malinen <j@w1.fi>2009-12-02 16:43:09 +0200
commitd8222ae38c3be3fba794462d11fed8b57590c7f5 (patch)
treec24a3a41c91e283322fe23f3bf723d9856f7db23
parente0e14a7bc337b2827ea2ddd81b2a13fb06c8911f (diff)
downloadexternal_wpa_supplicant_8_ti-d8222ae38c3be3fba794462d11fed8b57590c7f5.zip
external_wpa_supplicant_8_ti-d8222ae38c3be3fba794462d11fed8b57590c7f5.tar.gz
external_wpa_supplicant_8_ti-d8222ae38c3be3fba794462d11fed8b57590c7f5.tar.bz2
Fix driver initialization not to crash if driver does not use init2()
8a5ab9f5e56cd2f5781c2d92f41495e60d544780 fixed global driver context for init2(), but it also broke driver initialization with driver wrappers that do not use init2().. Fix this by setting wpa_s->global before it gets dereferenced.
-rw-r--r--wpa_supplicant/wpa_supplicant.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index d58e55b..dec408e 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2166,6 +2166,8 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
if (wpa_s == NULL)
return NULL;
+ wpa_s->global = global;
+
t_iface = *iface;
if (global->params.override_driver) {
wpa_printf(MSG_DEBUG, "Override interface parameter: driver "
@@ -2189,8 +2191,6 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
return NULL;
}
- wpa_s->global = global;
-
/* Notify the control interfaces about new iface */
if (wpas_notify_iface_added(wpa_s)) {
wpa_supplicant_deinit_iface(wpa_s);