Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pidfd: remove unneeded NULL check from pidfd_prepare()

None of the caller actually pass a NULL pid in there.

Link: https://lore.kernel.org/r/20250403-work-pidfd-fixes-v1-2-a123b6ed6716@kernel.org
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+1 -1
+1 -1
kernel/fork.c
··· 2110 2110 { 2111 2111 bool thread = flags & PIDFD_THREAD; 2112 2112 2113 - if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID)) 2113 + if (!pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID)) 2114 2114 return -EINVAL; 2115 2115 2116 2116 return __pidfd_prepare(pid, flags, ret);