From: Jouni Malinen Date: Wed, 31 Dec 2014 14:33:35 +0000 (+0200) Subject: D-Bus: Avoid compiler warning on sometimes uninitialized variable X-Git-Tag: hostap_2_4~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19d4dab759126b5e044fe845da8cca95a28e81c8;p=thirdparty%2Fhostap.git 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 --- 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 &&