Skip to content

Commit 1b09094

Browse files
committed
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/[email protected] Reviewed-by: Oleg Nesterov <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 76d2d75 commit 1b09094

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/fork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ int pidfd_prepare(struct pid *pid, unsigned int flags, struct file **ret)
21102110
{
21112111
bool thread = flags & PIDFD_THREAD;
21122112

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

21162116
return __pidfd_prepare(pid, flags, ret);

0 commit comments

Comments
 (0)