From 5c1660358f6349c71d1229adcb052dfcb02c0e7d Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 20 Nov 2017 17:33:25 +0200 Subject: [PATCH] shared/gatt-client: Check if ATT is connected before creating requests If ATT is not connected there is no point in creating a request since that will likely fail at bt_att_send. --- src/shared/gatt-client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index a34b00188..4b3f553f1 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -141,6 +141,9 @@ static struct request *request_create(struct bt_gatt_client *client) { struct request *req; + if (!client->att) + return NULL; + req = new0(struct request, 1); if (client->next_request_id < 1) -- 2.47.3