]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Remove unnecessary NULL check from hostapd_config_read_wpa_psk() call
authorJouni Malinen <j@w1.fi>
Mon, 26 Dec 2016 15:42:41 +0000 (17:42 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 26 Dec 2016 15:42:41 +0000 (17:42 +0200)
This function is already checking the fname argument against NULL, so
use that check on its own instead of duplicating the check in the only
caller.

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

index 97241cf611d587c3c15c8a50e4f9801e80bc570e..c532bf03daf8ca7936e48abda94572e101d87ee3 100644 (file)
@@ -333,13 +333,7 @@ int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf)
                ssid->wpa_psk->group = 1;
        }
 
-       if (ssid->wpa_psk_file) {
-               if (hostapd_config_read_wpa_psk(ssid->wpa_psk_file,
-                                               &conf->ssid))
-                       return -1;
-       }
-
-       return 0;
+       return hostapd_config_read_wpa_psk(ssid->wpa_psk_file, &conf->ssid);
 }