From: Dan Carpenter Date: Tue, 09 Jan 2018 20:06:00 +0000 Subject: [PATCH] mm, hugetlb: Fix a double unlock bug in alloc_surplus_huge_page() Message-Id: <20180109200559.g3iz5kvbdrz7yydp@mwanda> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrew Morton , Michal Hocko Cc: Mike Kravetz , Naoya Horiguchi , Stephen Rothwell , Punit Agrawal , "Aneesh Kumar K.V" , Andrea Arcangeli , linux-mm@kvack.org, kernel-janitors@vger.kernel.org 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 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); /*