Unverified Commit 1b090949 authored by Christian Brauner's avatar Christian Brauner
Browse files

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: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 76d2d75d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2110,7 +2110,7 @@ int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret)
{
	bool thread = flags & PIDFD_THREAD;

	if (!pid || !pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID))
	if (!pid_has_task(pid, thread ? PIDTYPE_PID : PIDTYPE_TGID))
		return -EINVAL;

	return __pidfd_prepare(pid, flags, ret);