Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib: Fix bug in tst_test metadata validation
@ 2025-04-08 14:09 Martin Doucha
  2025-04-11 11:59 ` Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin Doucha @ 2025-04-08 14:09 UTC (permalink / raw)
  To: ltp

The results pointer is NULL when do_setup() checks tst_test metadata
validity. Print the invalid runtime value from the correct pointer.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 lib/tst_test.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 9a23cd4a0..694861d95 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1267,10 +1267,8 @@ static void do_setup(int argc, char *argv[])
 			tst_test->timeout);
 	}
 
-	if (tst_test->runtime < 0) {
-		tst_brk(TBROK, "Invalid runtime value %i",
-			results->runtime);
-	}
+	if (tst_test->runtime < 0)
+		tst_brk(TBROK, "Invalid runtime value %i", tst_test->runtime);
 
 	if (tst_test->tconf_msg)
 		tst_brk(TCONF, "%s", tst_test->tconf_msg);
-- 
2.49.0


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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-11 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 14:09 [LTP] [PATCH] lib: Fix bug in tst_test metadata validation Martin Doucha
2025-04-11 11:59 ` Petr Vorel
2025-04-11 12:00 ` Petr Vorel
2025-04-11 12:11 ` Cyril Hrubis
2025-04-11 13:02   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox