diff mbox series

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

Message ID 20220921215342.2263924-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ] shared/gatt-db: Fix scan-build warning | expand

Commit Message

Luiz Augusto von Dentz Sept. 21, 2022, 9:53 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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

Patch

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;