]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Check hapd_iface more consistently in hostapd_disable_iface()
authorJouni Malinen <j@w1.fi>
Sun, 11 Nov 2012 11:11:15 +0000 (13:11 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Nov 2012 11:11:15 +0000 (13:11 +0200)
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 <j@w1.fi>

src/ap/hostapd.c

index 61fd776a85c7b8d67a2e532795600653bd7b4172..1c968a7a777395dbd53581488c8f799a722f8f08 100644 (file)
@@ -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;