aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-01 20:36:52 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-02 20:50:27 (GMT)
commita0caebf3977a037a87e4636b2bb7be5ae1b3fe4d (patch)
treebe355e4ba19b76095893ce461a9ca7e5e49b27e1 /wpa_supplicant/dbus/dbus_new_handlers_p2p.c
parentff1d8104e230b3d2da67d79211b3803d22a42b72 (diff)
downloadhostap-a0caebf3977a037a87e4636b2bb7be5ae1b3fe4d.zip
hostap-a0caebf3977a037a87e4636b2bb7be5ae1b3fe4d.tar.gz
hostap-a0caebf3977a037a87e4636b2bb7be5ae1b3fe4d.tar.bz2
D-Bus: Simplify out-of-memory reporting
There is no need to have separate wpa_printf() and different error message strings for the unlikely out-of-error messages. Use a helper function, wpas_dbus_error_no_memory(), to get consistent behavior with a one-line call. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers_p2p.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers_p2p.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
index 7485c13..a526b91 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
@@ -186,8 +186,7 @@ DBusMessage * wpas_dbus_handler_p2p_listen(DBusMessage *message,
if (!dbus_message_get_args(message, NULL, DBUS_TYPE_INT32, &timeout,
DBUS_TYPE_INVALID))
- return dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
- NULL);
+ return wpas_dbus_error_no_memory(message);
if (wpa_s->p2p_dev)
wpa_s = wpa_s->p2p_dev;
@@ -1784,15 +1783,13 @@ DBusMessage * wpas_dbus_handler_add_persistent_group(
reply = dbus_message_new_method_return(message);
if (reply == NULL) {
- reply = dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
- NULL);
+ reply = wpas_dbus_error_no_memory(message);
goto err;
}
if (!dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID)) {
dbus_message_unref(reply);
- reply = dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
- NULL);
+ reply = wpas_dbus_error_no_memory(message);
goto err;
}