[PATCH 07/12] android/gatt: Add missing error check

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

Fixes clang warning:
...
android/gatt.c:2097:4: warning: Value stored to 'srvc_search_success' is
never read
       srvc_search_success = search_dev_for_srvc(conn, NULL);
...
---
 android/gatt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index b47ba83..fa7e1c3 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2093,9 +2093,13 @@ static void handle_client_search_service(const void *buf, uint16_t len)
 		}
 	} else {
 		/* Refresh service cache if only partial search was performed */
-		if (conn->device->partial_srvc_search)
+		if (conn->device->partial_srvc_search) {
 			srvc_search_success = search_dev_for_srvc(conn, NULL);
-		else
+			if (!srvc_search_success) {
+				status = HAL_STATUS_FAILED;
+				goto reply;
+			}
+		} else
 			queue_foreach(conn->device->services,
 						send_client_primary_notify,
 						INT_TO_PTR(cmd->conn_id));
-- 
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