diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 16513cd23d5d7..07abcb6eb2030 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2933,8 +2933,8 @@ static int alloc_and_dissolve_hugetlb_folio(struct hstate *h, */ spin_unlock_irq(&hugetlb_lock); isolated = isolate_hugetlb(old_folio, list); - spin_lock_irq(&hugetlb_lock); ret = isolated ? 0 : -EBUSY; + spin_lock_irq(&hugetlb_lock); goto free_new; } else if (!folio_test_hugetlb_freed(old_folio)) { /*