]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use more consistent iface->conf checks
authorJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 09:51:16 +0000 (11:51 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 09:51:16 +0000 (11:51 +0200)
Commit f1df4fbfc7ad ("mesh: Use setup completion callback to complete
mesh join") added a check for iface->conf being NULL into a debug print.
However, it is not clear how that could be NULL here. In any case,
setup_interface() could end up dereferencing iface->conf in the call to
hostapd_validate_bssid_configuration(), so better be consistent with the
checks and not get warnings from static analyzers regardless of whether
this can happen in practice.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index e257174645ed4cc682bc6df25d043c70c1e87b4d..2f3e7878f6fcddfcd92383c616ab0bd6d219d801 100644 (file)
@@ -2308,10 +2308,12 @@ int hostapd_setup_interface(struct hostapd_iface *iface)
 {
        int ret;
 
+       if (!iface->conf)
+               return -1;
        ret = setup_interface(iface);
        if (ret) {
                wpa_printf(MSG_ERROR, "%s: Unable to setup interface.",
-                          iface->conf ? iface->conf->bss[0]->iface : "N/A");
+                          iface->conf->bss[0]->iface);
                return -1;
        }