All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ashwin Dayanand Kamat via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it, kashwindayan@vmware.com, akaher@vmware.com
Subject: [LTP] [PATCH] io_control01: Initialise the io_stats start structure
Date: Thu, 30 Mar 2023 10:53:48 +0530	[thread overview]
Message-ID: <1680153828-28376-1-git-send-email-kashwindayan@vmware.com> (raw)

struct io_stats start structure is a locally declared structure
which when not initialised can be filled with junk values in some platforms
like arm. These values are later compared and hence it leads to failure on
photon arm platform. Fix is to memset the structure.

Signed-off by: Ashwin Dayanand Kamat <kashwindayan@vmware.com>
---
 testcases/kernel/controllers/io/io_control01.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/controllers/io/io_control01.c b/testcases/kernel/controllers/io/io_control01.c
index c4e171af5..691196886 100644
--- a/testcases/kernel/controllers/io/io_control01.c
+++ b/testcases/kernel/controllers/io/io_control01.c
@@ -55,6 +55,7 @@ static void run(void)
 	char *buf = SAFE_MALLOC(MAX((size_t)BUFSIZ, pgsz));
 	struct io_stats start;
 
+	memset(&start, 0, sizeof(struct io_stats));
 	SAFE_CG_READ(tst_cg, "io.stat", buf, BUFSIZ - 1);
 	line = strtok_r(buf, "\n", &buf_ptr);
 	while (line) {
-- 
2.39.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2023-03-30  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  5:23 Ashwin Dayanand Kamat via ltp [this message]
2023-03-30  9:34 ` [LTP] [PATCH] io_control01: Initialise the io_stats start structure Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1680153828-28376-1-git-send-email-kashwindayan@vmware.com \
    --to=ltp@lists.linux.it \
    --cc=akaher@vmware.com \
    --cc=kashwindayan@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.