[PATCH] nandtest: fix wrong initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Reported-by: Andreas Helmcke <ahelmcke@xxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux