Fix crash on channel list changed event during driver init

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.
This commit is contained in:
Jouni Malinen 2010-10-20 19:30:55 +03:00 committed by Jouni Malinen
parent ef10f4733f
commit 35c5d61037

View 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); wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
break; break;
case EVENT_CHANNEL_LIST_CHANGED: case EVENT_CHANNEL_LIST_CHANGED:
if (wpa_s->drv_priv == NULL)
break; /* Ignore event during drv initialization */
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
wpas_p2p_update_channel_list(wpa_s); wpas_p2p_update_channel_list(wpa_s);
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */