OSDN Git Service

shared/gatt-client: Fix not checking the return of bt_gatt_client_read_value
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 29 Aug 2016 09:17:15 +0000 (12:17 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 30 Aug 2016 08:14:11 +0000 (11:14 +0300)
If the bt_gatt_client_read_value fails the whole discovery would stall
as ext_prop_read_cb would not be called.

src/shared/gatt-client.c

index 8fd8a45..4386692 100644 (file)
@@ -631,9 +631,11 @@ static bool read_ext_prop_desc(struct discovery_op *op)
                return false;
 
        handle = gatt_db_attribute_get_handle(attr);
-       bt_gatt_client_read_value(client, handle, ext_prop_read_cb,
+
+       if (!bt_gatt_client_read_value(client, handle, ext_prop_read_cb,
                                                        discovery_op_ref(op),
-                                                       discovery_op_unref);
+                                                       discovery_op_unref))
+               return false;
 
        return true;
 }