[PATCH 2/2] android/gatt: Fix not setting request as done on direct db read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Previously if read was succesfull - request was not marked as completed
because no callback was called for direct db read.
---
 android/gatt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index a61d702..46dc7f6 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4086,10 +4086,11 @@ static void read_requested_attributes(void *data, void *user_data)
 
 	/* We have value here already if no callback will be called */
 	if (value_len >= 0) {
+		resp_data->state = REQUEST_DONE;
+
 		resp_data->value = malloc0(value_len);
 		if (!resp_data->value) {
 			/* If data cannot be copied, act like when read fails */
-			resp_data->state = REQUEST_DONE;
 			resp_data->error = ATT_ECODE_INSUFF_RESOURCES;
 			return;
 		}
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux