From 40c82bb436829832c0bef40aed6449d296f90dfb Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 3 Mar 2011 17:56:09 +0100 Subject: [PATCH] bluetooth: Set service state to IDLE when PAN connection fails --- plugins/bluetooth.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 8c8840f..ccc5e9b 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -99,7 +99,8 @@ static void connect_reply(DBusPendingCall *call, void *user_data) if (dbus_set_error_from_message(&error, reply) == TRUE) { connman_error("%s", error.message); dbus_error_free(&error); - goto done; + + goto err; } if (dbus_message_get_args(reply, &error, @@ -110,11 +111,11 @@ static void connect_reply(DBusPendingCall *call, void *user_data) dbus_error_free(&error); } else connman_error("Wrong arguments for connect"); - goto done; + goto err; } if (interface == NULL) - goto done; + goto err; DBG("interface %s", interface); @@ -124,7 +125,15 @@ static void connect_reply(DBusPendingCall *call, void *user_data) connman_network_set_connected(network, TRUE); -done: + dbus_message_unref(reply); + + dbus_pending_call_unref(call); + + return; +err: + + connman_network_set_connected(network, FALSE); + dbus_message_unref(reply); dbus_pending_call_unref(call); -- 2.7.4