Skip to content

Commit e807042

Browse files
melverpaulmckrcu
authored andcommitted
kcsan: test: Defer kcsan_test_init() after kunit initialization
When the test is built into the kernel (not a module), kcsan_test_init() and kunit_init() both use late_initcall(), which means kcsan_test_init() might see a NULL debugfs_rootdir as parent dentry, resulting in kcsan_test_init() and kcsan_debugfs_init() both trying to create a debugfs node named "kcsan" in debugfs root. One of them will show an error and be unsuccessful. Defer kcsan_test_init() until we're sure kunit was initialized. Signed-off-by: Marco Elver <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 6880fa6 commit e807042

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/kcsan/kcsan_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ static void kcsan_test_exit(void)
12241224
tracepoint_synchronize_unregister();
12251225
}
12261226

1227-
late_initcall(kcsan_test_init);
1227+
late_initcall_sync(kcsan_test_init);
12281228
module_exit(kcsan_test_exit);
12291229

12301230
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)