[PATCH 10/12] android/gatt: Fix length check

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

Function fill_gatt_response() has check shown below:
	if (!len)
		return;

This eliminates clang warning:
...
android/gatt.c:4443:3: warning: Function call argument is an
uninitialized value
                fill_gatt_response(resp_data, resp_data->handle,
...
---
 android/gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index fa7e1c3..d37a581 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -4439,7 +4439,7 @@ static void read_requested_attributes(void *data, void *user_data)
 
 done:
 	/* We have value here already if no callback will be called */
-	if (value_len >= 0)
+	if (value_len > 0)
 		fill_gatt_response(resp_data, resp_data->handle,
 					resp_data->offset, error, value_len,
 					value);
-- 
1.9.1

--
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