summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArman Uguray <armansito@chromium.org>2014-11-24 15:03:52 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-11-25 23:49:56 +0200
commitc9748778ac2932d86e10a89f269766e938c40961 (patch)
tree9b1c0658172804d97c4a099a1b00486c2b9505de /src
parentd8f6a237ab3b91f540f2b8b71fb6a9bece1ae659 (diff)
downloadbluez-c9748778ac2932d86e10a89f269766e938c40961.tar.gz
shared/gatt-client: Call ready_handler only in init
Currently disconnect_cb calls ready_handler to notify the upper layer if a disconnect occurred during initialization. This patch fixes it so that the handler is only called if in_init is set.
Diffstat (limited to 'src')
-rw-r--r--src/shared/gatt-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index 4a645eba2..033cba17f 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -1455,6 +1455,7 @@ static void bt_gatt_client_free(struct bt_gatt_client *client)
static void att_disconnect_cb(void *user_data)
{
struct bt_gatt_client *client = user_data;
+ bool in_init = client->in_init;
client->disc_id = 0;
@@ -1464,7 +1465,7 @@ static void att_disconnect_cb(void *user_data)
client->in_init = false;
client->ready = false;
- if (client->ready_callback)
+ if (in_init && client->ready_callback)
client->ready_callback(false, 0, client->ready_data);
}