diff --git a/kernel/fork.c b/kernel/fork.c index 751647c267c1..2a8a736902f8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2067,6 +2067,7 @@ static __latent_entropy struct task_struct *copy_process( O_RDWR | O_CLOEXEC); if (IS_ERR(pidfile)) { put_unused_fd(pidfd); + retval = PTR_ERR(pidfile); goto bad_fork_free_pid; } get_pid(pid); /* held by pidfile now */