[PATCH] fwts_devicetree: clean up static analysis warning

Colin King colin.king at canonical.com
Wed Sep 22 08:48:04 UTC 2021


From: Colin Ian King <colin.king at canonical.com>

The variable length should be initialized to zero to clean up
an overly pedantic static analysis warning of an uninitialized
variable.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_devicetree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
index 5556446c..dcd5f5f0 100644
--- a/src/lib/src/fwts_devicetree.c
+++ b/src/lib/src/fwts_devicetree.c
@@ -265,7 +265,7 @@ int fwts_dt_stringlist_count(
 	const char *property)
 {
 	const char *list, *end;
-	int length, count = 0;
+	int length = 0, count = 0;
 
 	list = fdt_getprop(fdt, nodeoffset, property, &length);
 	if (!list) {
-- 
2.32.0




More information about the fwts-devel mailing list