mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 17:18:25 +02:00
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>
This commit is contained in:
parent
76d2d75ddc
commit
1b090949c9
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue