From: Michal Hocko Date: Wed, 10 Jan 2018 10:14:39 +0000 Subject: Re: [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page() Message-Id: <20180110101439.GQ1732@dhcp22.suse.cz> List-Id: References: <20180109200559.g3iz5kvbdrz7yydp@mwanda> In-Reply-To: <20180109200559.g3iz5kvbdrz7yydp@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Andrew Morton , Mike Kravetz , Naoya Horiguchi , Stephen Rothwell , Punit Agrawal , "Aneesh Kumar K.V" , Andrea Arcangeli , linux-mm@kvack.org, kernel-janitors@vger.kernel.org On Tue 09-01-18 23:06:00, Dan Carpenter wrote: > We aren't holding the hugetlb_lock so there is no need to unlock. > > Fixes: b27f11e5e675 ("mm, hugetlb: get rid of surplus page accounting tricks") > Signed-off-by: Dan Carpenter Ups, a left over after refactoring. Andrew, could you fold this into mm-hugetlb-further-simplify-hugetlb-allocation-api.patch please? > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index ffcae114ceed..742a929f2311 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1567,7 +1567,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, > > page = alloc_fresh_huge_page(h, gfp_mask, nid, nmask); > if (!page) > - goto out_unlock; > + return NULL; > > spin_lock(&hugetlb_lock); > /* -- Michal Hocko SUSE Labs