From: Jouni Malinen Date: Mon, 26 Dec 2016 15:42:41 +0000 (+0200) Subject: Remove unnecessary NULL check from hostapd_config_read_wpa_psk() call X-Git-Tag: hostap_2_7~1946 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34e29dfd4b98f50f324cee465fb24cfb1291660b;p=thirdparty%2Fhostap.git Remove unnecessary NULL check from hostapd_config_read_wpa_psk() call 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 --- diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 97241cf61..c532bf03d 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -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); }