From 19d4dab759126b5e044fe845da8cca95a28e81c8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 31 Dec 2014 16:33:35 +0200 Subject: [PATCH] D-Bus: Avoid compiler warning on sometimes uninitialized variable The logic in wpas_dbus_signal_p2p_provision_discovery() seemed to imply that there could be a case where _signal would be used uninitized. While that is not the case since either (request || !status) or (!request && status) would always be true, some compilers do not seem to be clever enough to figure that out to avoid the warning. Make this easier for such compilers by removing the (!request && status) condition since it is identical to !(request || !status). Signed-off-by: Jouni Malinen --- wpa_supplicant/dbus/dbus_new.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 228600acd..5c4a12bee 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -1056,9 +1056,10 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s, "ProvisionDiscoveryPBCResponse"; else return; /* Unknown or un-supported method */ - } else if (!request && status) + } else { /* Explicit check for failure response */ _signal = "ProvisionDiscoveryFailure"; + } add_pin = ((request && (config_methods & WPS_CONFIG_DISPLAY)) || (!request && !status &&