From: Oleg Nesterov <oleg@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Gargi Sharma <gs051095@gmail.com>, Rik van Riel <riel@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] Fix failure path in alloc_pid()
Date: Thu, 20 Dec 2018 17:20:48 +0100 [thread overview]
Message-ID: <20181220162048.GB31865@redhat.com> (raw)
In-Reply-To: <20181218215321.GW10600@bombadil.infradead.org>
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@redhat.com>
prev parent reply other threads:[~2018-12-20 16:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-18 21:53 [RFC] Fix failure path in alloc_pid() Matthew Wilcox
2018-12-19 9:28 ` Eric W. Biederman
2018-12-20 16:20 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181220162048.GB31865@redhat.com \
--to=oleg@redhat.com \
--cc=ebiederm@xmission.com \
--cc=gs051095@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riel@redhat.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.