]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix crash on channel list changed event during driver init
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 20 Oct 2010 16:30:55 +0000 (19:30 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 20 Oct 2010 16:30:55 +0000 (19:30 +0300)
The driver wrapper may indicate EVENT_CHANNEL_LIST_CHANGED before
completing init(). This would likely result in segfault when driver
channel list is being read as part of processing this event when
P2P is enabled.

wpa_supplicant/events.c

index a4ee308a393f3d1c1e86390c985fc7f68ee59edb..de030d253fadd1a010aaaa9162b5bca213d13e83 100644 (file)
@@ -1833,6 +1833,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
                break;
        case EVENT_CHANNEL_LIST_CHANGED:
+               if (wpa_s->drv_priv == NULL)
+                       break; /* Ignore event during drv initialization */
 #ifdef CONFIG_P2P
                wpas_p2p_update_channel_list(wpa_s);
 #endif /* CONFIG_P2P */