Thread (2 messages) flat view 2 messages, 2 authors, 2022-09-21
STALE1456d

[PATCH BlueZ] shared/gatt-db: Fix scan-build warning

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2022-09-21 21:53:58
Subsystem: the rest · Maintainer: Linus Torvalds

From: Luiz Augusto von Dentz <redacted>

This fixes the following warning:

src/shared/gatt-db.c:1339:2: warning: Undefined or garbage value
returned to caller [core.uninitialized.UndefReturn]
        return data.num_of_res;
        ^~~~~~~~~~~~~~~~~~~~~~
---
 src/shared/gatt-db.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c
index 32cbf6cdc38b..ff2502ff9681 100644
--- a/src/shared/gatt-db.c
+++ b/src/shared/gatt-db.c
@@ -1328,6 +1328,7 @@ unsigned int gatt_db_find_by_type_value(struct gatt_db *db,
 {
 	struct find_by_type_value_data data;
 
+	memset(&data, 0, sizeof(data));
 	data.func = func;
 	data.user_data = user_data;
 	data.value = value;
-- 
2.37.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help