P2P: Fix WpsFailed signal in P2P D-Bus

Fix a NULL pointer dereference in commit
3734552f15 in the case of PBC overlap and
timeout case.

Signed-off-by: Jean-Michel.Bachot <jean-michelx.bachot@intel.com>
Signed-off-by: Jayant Sane <jayant.sane@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
This commit is contained in:
Jean-Michel.Bachot 2011-06-25 15:26:04 +03:00 committed by Jouni Malinen
parent 2463ba70e2
commit 8be6450cb6

View File

@ -226,21 +226,23 @@ static void ap_wps_event_cb(void *ctx, enum wps_event event,
{ {
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
struct wpa_supplicant *wpa_s = ctx; struct wpa_supplicant *wpa_s = ctx;
struct wps_event_fail *fail = &data->fail;
if (event == WPS_EV_FAIL && wpa_s->parent && wpa_s->parent != wpa_s && if (event == WPS_EV_FAIL) {
wpa_s == wpa_s->global->p2p_group_formation) { struct wps_event_fail *fail = &data->fail;
/* if (wpa_s->parent && wpa_s->parent != wpa_s &&
* src/ap/wps_hostapd.c has already sent this on the main wpa_s == wpa_s->global->p2p_group_formation) {
* interface, so only send on the parent interface here if /*
* needed. * src/ap/wps_hostapd.c has already sent this on the
*/ * main interface, so only send on the parent interface
wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_FAIL * here if needed.
"msg=%d config_error=%d", */
fail->msg, fail->config_error); wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_FAIL
"msg=%d config_error=%d",
fail->msg, fail->config_error);
}
wpas_p2p_wps_failed(wpa_s, fail);
} }
wpas_p2p_wps_failed(wpa_s, fail);
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
} }