From: Marco Elver Date: Mon, 9 Aug 2021 11:25:09 +0000 (+0200) Subject: kcsan: test: Defer kcsan_test_init() after kunit initialization X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e80704272f5c3f80d315144b5eeaf867082c94ad;p=linux.git 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 Signed-off-by: Paul E. McKenney --- diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index dc55fd5a36fcc..df041bdb60885 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -1224,7 +1224,7 @@ static void kcsan_test_exit(void) tracepoint_synchronize_unregister(); } -late_initcall(kcsan_test_init); +late_initcall_sync(kcsan_test_init); module_exit(kcsan_test_exit); MODULE_LICENSE("GPL v2");