From 8cd93a01a9dd9a391fcd3265e805c8af9173772c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 11 Nov 2012 13:11:15 +0200 Subject: [PATCH] Check hapd_iface more consistently in hostapd_disable_iface() There is no point in the hapd_iface == NULL validate after this pointer has been dereferences, so move the code dereferencing hapd_iface after the check. Signed-hostap: Jouni Malinen --- src/ap/hostapd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 61fd776a8..1c968a7a7 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1113,12 +1113,13 @@ int hostapd_reload_iface(struct hostapd_iface *hapd_iface) int hostapd_disable_iface(struct hostapd_iface *hapd_iface) { size_t j; - struct hostapd_bss_config *bss = hapd_iface->bss[0]->conf; + struct hostapd_bss_config *bss; const struct wpa_driver_ops *driver; void *drv_priv; if (hapd_iface == NULL) return -1; + bss = hapd_iface->bss[0]->conf; driver = hapd_iface->bss[0]->driver; drv_priv = hapd_iface->bss[0]->drv_priv;