From: Tio Zhang Date: Wed, 20 Aug 2025 10:18:46 +0000 (+0800) Subject: fork: remove #ifdef CONFIG_LOCKDEP in copy_process() X-Git-Tag: v6.18-rc1~129^2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b32730e68d326bef5c081c4b7cdd275c45b1902b;p=thirdparty%2Flinux.git fork: remove #ifdef CONFIG_LOCKDEP in copy_process() 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 Cc: Kees Cook Signed-off-by: Andrew Morton --- diff --git a/kernel/fork.c b/kernel/fork.c index af673856499dc..e06cfaa85a84b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -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 */