Skip to content

Commit 40c5597

Browse files
mdouchapevik
authored andcommitted
lib: Fix bug in tst_test metadata validation
The results pointer is NULL when do_setup() checks tst_test metadata validity. Print the invalid runtime value from the correct pointer. Link: https://lore.kernel.org/ltp/20250408140944.36020-1-mdoucha@suse.cz/ Fixes: a6a369c ("lib: redefine the overall timeout logic of test") Reviewed-by: Petr Vorel <pvorel@suse.cz> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
1 parent e2bbba0 commit 40c5597

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/tst_test.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,8 @@ static void do_setup(int argc, char *argv[])
12671267
tst_test->timeout);
12681268
}
12691269

1270-
if (tst_test->runtime < 0) {
1271-
tst_brk(TBROK, "Invalid runtime value %i",
1272-
results->runtime);
1273-
}
1270+
if (tst_test->runtime < 0)
1271+
tst_brk(TBROK, "Invalid runtime value %i", tst_test->runtime);
12741272

12751273
if (tst_test->tconf_msg)
12761274
tst_brk(TCONF, "%s", tst_test->tconf_msg);

0 commit comments

Comments
 (0)