From 57fec19dab8adf6af7a34711e7a3e01b4f2e4ebc Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Feb 2021 11:51:16 +0200 Subject: [PATCH] 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 --- src/ap/hostapd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }