[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210428212430.GA6462@xz-x1>
Date: Wed, 28 Apr 2021 17:24:30 -0400
From: Peter Xu <peterx@...hat.com>
To: Hugh Dickins <hughd@...gle.com>
Cc: Axel Rasmussen <axelrasmussen@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Lokesh Gidra <lokeshgidra@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] userfaultfd: release page in error path to avoid BUG_ON
On Wed, Apr 28, 2021 at 02:03:05PM -0700, Hugh Dickins wrote:
[...]
> > > + put_page(*pagep);
> > > + *pagep = NULL;
> > > + }
> > > goto out;
> >
> > All "goto out" in this functions looks weird as it returns directly... so if
> > you're touching this after all, I suggest we do "return -ENOMEM" directly and
> > drop the "ret = -ENOMEM".
>
> No strong feeling either way from me on that: whichever looks best
> to you. But I suspect the "ret = -ENOMEM" cannot be dropped,
> because it's relied on further down too?
Ah sorry I just noticed Axel didn't really touch that line.. :) So yeah please
also feel free to keep it as is.
If to drop it, "ret = -ENOMEM" can go as well, I think.. since all later errors
should always reset variable "ret".
Thanks,
--
Peter Xu
Powered by blists - more mailing lists