diff mbox series

io_control01: Initialise the io_stats start structure

Message ID 1680153828-28376-1-git-send-email-kashwindayan@vmware.com
State Accepted
Headers show
Series io_control01: Initialise the io_stats start structure | expand

Commit Message

Ashwin Dayanand Kamat March 30, 2023, 5:23 a.m. UTC
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(+)

Comments

Cyril Hrubis March 30, 2023, 9:34 a.m. UTC | #1
Hi!
Applied, thanks.
diff mbox series

Patch

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) {