[PATCH 20/32] misc: ubootvar: always initialize struct ubootvar_data::flag

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Sep 5 02:55:45 PDT 2022


The flag member is only relevant to redundant environments, still we
shouldn't store garbage there for the non-redundant case. Thus
initialize it to an acceptable default: FLAG_NONE.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/misc/ubootvar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/ubootvar.c b/drivers/misc/ubootvar.c
index d98a6ed9a742..723e9e2b547a 100644
--- a/drivers/misc/ubootvar.c
+++ b/drivers/misc/ubootvar.c
@@ -181,7 +181,7 @@ static int ubootenv_probe(struct device_d *dev)
 	unsigned int crc_ok = 0;
 	int ret, i, current, count = 0;
 	uint32_t crc[2];
-	uint8_t flag[2];
+	uint8_t flag[2] = { FLAG_NONE, FLAG_NONE };
 	size_t size[2];
 	void *blob[2] = { NULL, NULL };
 	uint8_t *data[2];
-- 
2.30.2




More information about the barebox mailing list