]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix WpsFailed signal in P2P D-Bus
authorJean-Michel.Bachot <jean-michelx.bachot@intel.com>
Sat, 25 Jun 2011 12:26:04 +0000 (15:26 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 25 Jun 2011 12:29:31 +0000 (15:29 +0300)
Fix a NULL pointer dereference in commit
3734552f15856f3247f8bc484ffdb6d2a7d08113 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>
wpa_supplicant/ap.c

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