[PATCH] nandtest: fix wrong initialization
Sascha Hauer
s.hauer at pengutronix.de
Mon Jun 10 05:38:54 PDT 2024
ecc_stats is not a pointer, so sizeof(*ecc_stats) is wrong. Use
sizeof(ecc_stats) to avoid showing invalid ecc values.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
Reported-by: Andreas Helmcke <ahelmcke at ela-soft.com>
---
commands/nandtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/nandtest.c b/commands/nandtest.c
index 4a7db9cc74..765785f091 100644
--- a/commands/nandtest.c
+++ b/commands/nandtest.c
@@ -210,7 +210,7 @@ static int do_nandtest(int argc, char *argv[])
markbad = 0;
fd = -1;
- memset(ecc_stats, 0, sizeof(*ecc_stats));
+ memset(ecc_stats, 0, sizeof(ecc_stats));
while ((opt = getopt(argc, argv, "ms:i:o:l:tr")) > 0) {
switch (opt) {
--
2.39.2
More information about the barebox
mailing list