Skip to contentSkip to conversation

selftests/sched_ext: Add missing error check for exit__load()

PATCH Applied David Carlier 2 participants 2 messages Mar 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/sched_ext: Add missing error check for exit__load()

exit__load(skel) was called without checking its return value. Every other test in the suite wraps the load call with SCX_FAIL_IF(). Add the missing check to be consistent with the rest of the test suite.

Fixes a5db7817af78 ("sched_ext: Add selftests")
---
 tools/testing/selftests/sched_ext/exit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sched_ext/exit.c +1 -1
index ee25824b1cbe..b987611789d1 100644
@@ -33,7 +33,7 @@ static enum scx_test_status run(void *ctx)
 		skel = exit__open();
 		SCX_ENUM_INIT(skel);
 		skel->rodata->exit_point = tc;
-		exit__load(skel);
+		SCX_FAIL_IF(exit__load(skel), "Failed to load skel");
 		link = bpf_map__attach_struct_ops(skel->maps.exit_ops);
 		if (!link) {
 			SCX_ERR("Failed to attach scheduler");
Signature · 1 line
2.51.0
reviewer Applied
#1 lore raw

Applied to sched_ext/for-7.1.

Thanks.

--
tejun