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 <[email protected]>
Reported-by: Andreas Helmcke <[email protected]>
---
 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


Reply via email to