From 34e29dfd4b98f50f324cee465fb24cfb1291660b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 26 Dec 2016 17:42:41 +0200 Subject: [PATCH] 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 --- src/ap/ap_config.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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); }