summaryrefslogtreecommitdiff
path: root/plugins/bluetooth.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-03-03 17:56:09 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-03 17:56:09 +0100
commit40c82bb436829832c0bef40aed6449d296f90dfb (patch)
tree184012732ba7dbfaff59a45934452d233cf04c0b /plugins/bluetooth.c
parent672a33a8a96cc0f8dadadd442cb066bcc84be519 (diff)
downloadconnman-40c82bb436829832c0bef40aed6449d296f90dfb.tar.gz
bluetooth: Set service state to IDLE when PAN connection fails
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r--plugins/bluetooth.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index 8c8840f8..ccc5e9bb 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);