From: Jouni Malinen Date: Sun, 28 Feb 2021 09:51:16 +0000 (+0200) Subject: Use more consistent iface->conf checks X-Git-Tag: hostap_2_10~506 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57fec19dab8adf6af7a34711e7a3e01b4f2e4ebc;p=thirdparty%2Fhostap.git Use more consistent iface->conf checks 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 --- diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index e25717464..2f3e7878f 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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; }