From a22fdb6f0e70cee86850d872817581cc158d4b74 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Fri, 10 Apr 2015 14:29:13 -0700 Subject: [PATCH] shared/gatt: Fix potential uninitialized usage Fixed the following warning when compiled with clang: error: variable 'success' is used uninitialized whenever 'if' condition is false if (last_handle != op->end_handle) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/shared/gatt-helpers.c:1263:28: note: uninitialized use occurs here discovery_op_complete(op, success, att_ecode); ^~~~~~~ --- src/shared/gatt-helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c index 1076a6a45..c773df7f1 100644 --- a/src/shared/gatt-helpers.c +++ b/src/shared/gatt-helpers.c @@ -1259,6 +1259,8 @@ static void discover_chrcs_cb(uint8_t opcode, const void *pdu, goto done; } + success = true; + done: discovery_op_complete(op, success, att_ecode); } -- 2.47.3