]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fork: remove #ifdef CONFIG_LOCKDEP in copy_process()
authorTio Zhang <tiozhang@didiglobal.com>
Wed, 20 Aug 2025 10:18:46 +0000 (18:18 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 14 Sep 2025 00:32:48 +0000 (17:32 -0700)
lockdep_init_task() is defined as an empty when CONFIG_LOCKDEP is not set.
So the #ifdef here is redundant, remove it.

Link: https://lkml.kernel.org/r/20250820101826.GA2484@didi-ThinkCentre-M930t-N000
Signed-off-by: Tio Zhang <tiozhang@didiglobal.com>
Cc: Kees Cook <kees@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/fork.c

index af673856499dcaa35e135a9e8042ef28d5c5370d..e06cfaa85a84b2b799593bdf810b8138e6de5d96 100644 (file)
@@ -2124,9 +2124,7 @@ __latent_entropy struct task_struct *copy_process(
 
        p->pagefault_disabled = 0;
 
-#ifdef CONFIG_LOCKDEP
        lockdep_init_task(p);
-#endif
 
        p->blocked_on = NULL; /* not blocked yet */