[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181220162048.GB31865@redhat.com>
Date: Thu, 20 Dec 2018 17:20:48 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Gargi Sharma <gs051095@...il.com>,
Rik van Riel <riel@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC] Fix failure path in alloc_pid()
On 12/18, Matthew Wilcox wrote:
>
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -233,8 +233,11 @@ struct pid *alloc_pid(struct pid_namespace *ns)
>
> out_free:
> spin_lock_irq(&pidmap_lock);
> - while (++i <= ns->level)
> - idr_remove(&ns->idr, (pid->numbers + i)->nr);
> + upid = pid->numbers + i;
> + while (++i <= ns->level) {
> + upid++;
> + idr_remove(&upid->ns->idr, upid->nr);
can't resist...
while (++i <= ns->level) {
upid = pid->numbers + i;
idr_remove(&upid->ns->idr, upid->nr);
}
looks a bit more clean to me, but this is cosmetic and subjective.
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
Powered by blists - more mailing lists