sparc32: mm: Don't try to free page-table pages if ctor() fails
authorWill Deacon <will@kernel.org>
Tue, 26 May 2020 17:33:00 +0000 (18:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jun 2020 01:45:51 +0000 (18:45 -0700)
The pages backing page-table allocations for SRMMU are allocated via
memblock as part of the "nocache" region initialisation during
srmmu_paging_init() and should not be freed even if a later call to
pgtable_pte_page_ctor() fails.

Remove the broken call to __free_page().

Cc: David S. Miller <davem@davemloft.net>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Fixes: 1ae9ae5f7df7 ("sparc: handle pgtable_page_ctor() fail")
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/srmmu.c

index c861c0f0df73d9607659c37b0b1705d09f81f7f5..589370a21b124b36cd92bc1ce916032f4ea4dd69 100644 (file)
@@ -365,7 +365,6 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
                return NULL;
        page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT);
        if (!pgtable_pte_page_ctor(page)) {
-               __free_page(page);
                return NULL;
        }
        return ptep;