mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 13:30:45 -05: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user