* [PATCH] nandtest: fix wrong initialization
@ 2024-06-10 12:38 Sascha Hauer
2024-06-10 12:42 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2024-06-10 12:38 UTC (permalink / raw)
To: Barebox List; +Cc: Andreas Helmcke
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@pengutronix.de>
Reported-by: Andreas Helmcke <ahelmcke@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-10 12:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 12:38 [PATCH] nandtest: fix wrong initialization Sascha Hauer
2024-06-10 12:42 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox