From 605325fb7501ad6ed619223b6f9839e007aed799 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 1 Jan 2015 02:10:37 +0200 Subject: [PATCH] D-Bus: Remove useless wpa_s->conf checks This cannot be NULL when an interface is in use. There is not much point in couple of functions checking this while large number of other places do not. Signed-off-by: Jouni Malinen --- wpa_supplicant/dbus/dbus_new_handlers.c | 28 --------------------- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 9 ------- 2 files changed, 37 deletions(-) diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index d55775961..3b93c7a1b 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -3345,14 +3345,6 @@ dbus_bool_t wpas_dbus_getter_networks(DBusMessageIter *iter, DBusError *error, unsigned int i = 0, num = 0; dbus_bool_t success = FALSE; - if (wpa_s->conf == NULL) { - wpa_printf(MSG_ERROR, "%s[dbus]: An error occurred getting " - "networks list.", __func__); - dbus_set_error(error, DBUS_ERROR_FAILED, "%s: an error " - "occurred getting the networks list", __func__); - return FALSE; - } - for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) if (!network_is_persistent_group(ssid)) num++; @@ -3407,16 +3399,6 @@ dbus_bool_t wpas_dbus_getter_pkcs11_engine_path(DBusMessageIter *iter, struct wpa_supplicant *wpa_s = user_data; const char *pkcs11_engine_path; - if (wpa_s->conf == NULL) { - wpa_printf(MSG_ERROR, - "wpas_dbus_getter_pkcs11_engine_path[dbus]: An " - "error occurred getting the PKCS #11 engine path."); - dbus_set_error_const( - error, DBUS_ERROR_FAILED, - "An error occured getting the PKCS #11 engine path."); - return FALSE; - } - if (wpa_s->conf->pkcs11_engine_path == NULL) pkcs11_engine_path = ""; else @@ -3442,16 +3424,6 @@ dbus_bool_t wpas_dbus_getter_pkcs11_module_path(DBusMessageIter *iter, struct wpa_supplicant *wpa_s = user_data; const char *pkcs11_module_path; - if (wpa_s->conf == NULL) { - wpa_printf(MSG_ERROR, - "wpas_dbus_getter_pkcs11_module_path[dbus]: An " - "error occurred getting the PKCS #11 module path."); - dbus_set_error_const( - error, DBUS_ERROR_FAILED, - "An error occured getting the PKCS #11 module path."); - return FALSE; - } - if (wpa_s->conf->pkcs11_module_path == NULL) pkcs11_module_path = ""; else diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index b1238add3..e24b216e9 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -1695,15 +1695,6 @@ dbus_bool_t wpas_dbus_getter_persistent_groups(DBusMessageIter *iter, unsigned int i = 0, num = 0; dbus_bool_t success = FALSE; - if (wpa_s->conf == NULL) { - wpa_printf(MSG_ERROR, "dbus: %s: " - "An error occurred getting persistent groups list", - __func__); - dbus_set_error_const(error, DBUS_ERROR_FAILED, "an error " - "occurred getting persistent groups list"); - return FALSE; - } - for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) if (network_is_persistent_group(ssid)) num++;