]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus: Avoid compiler warning on sometimes uninitialized variable
authorJouni Malinen <j@w1.fi>
Wed, 31 Dec 2014 14:33:35 +0000 (16:33 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Jan 2015 20:48:30 +0000 (22:48 +0200)
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 <j@w1.fi>
wpa_supplicant/dbus/dbus_new.c

index 228600acd661ce4a15523fb953e0d0ec4c0012d1..5c4a12bee937a1f994691c5c9e7300718067d448 100644 (file)
@@ -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 &&