Skip to content

Commit

Permalink
sparc32: mm: Don't try to free page-table pages if ctor() fails
Browse files Browse the repository at this point in the history
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: 1ae9ae5 ("sparc: handle pgtable_page_ctor() fail")
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Will Deacon authored and David S. Miller committed Jun 3, 2020
1 parent ee7c795 commit 454b028
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/sparc/mm/srmmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 454b028

Please sign in to comment.