shared/gatt-client: Fix not return error to callback
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 2 Jul 2020 16:01:05 +0000 (09:01 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
If a CCC request has been cancelled the pdu given to the callback will
be NULL which was not translated to a proper error.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/shared/gatt-client.c

index 11a5042..f837547 100644 (file)
@@ -1781,7 +1781,7 @@ static uint8_t process_error(const void *pdu, uint16_t length)
        const struct bt_att_pdu_error_rsp *error_pdu;
 
        if (!pdu || length != sizeof(struct bt_att_pdu_error_rsp))
-               return 0;
+               return BT_ATT_ERROR_UNLIKELY;
 
        error_pdu = pdu;