mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [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

* Re: [PATCH] nandtest: fix wrong initialization
  2024-06-10 12:38 [PATCH] nandtest: fix wrong initialization Sascha Hauer
@ 2024-06-10 12:42 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-06-10 12:42 UTC (permalink / raw)
  To: Barebox List, Sascha Hauer; +Cc: Andreas Helmcke


On Mon, 10 Jun 2024 14:38:54 +0200, Sascha Hauer wrote:
> ecc_stats is not a pointer, so sizeof(*ecc_stats) is wrong. Use
> sizeof(ecc_stats) to avoid showing invalid ecc values.
> 
> 

Applied, thanks!

[1/1] nandtest: fix wrong initialization
      https://git.pengutronix.de/cgit/barebox/commit/?id=6bf5bc6ac10c (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ 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