Skip to content

Commit

Permalink
sparc: Fix handling of page table constructor failure
Browse files Browse the repository at this point in the history
The page has just been allocated, so its refcount is 1.  free_unref_page()
is for use on pages which have a zero refcount.  Use __free_page()
like the other implementations of pte_alloc_one().

Fixes: 1ae9ae5 ("sparc: handle pgtable_page_ctor() fail")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matthew Wilcox (Oracle) authored and David S. Miller committed Feb 19, 2021
1 parent 80bddf5 commit a970a97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
if (!page)
return NULL;
if (!pgtable_pte_page_ctor(page)) {
free_unref_page(page);
__free_page(page);
return NULL;
}
return (pte_t *) page_address(page);
Expand Down

0 comments on commit a970a97

Please sign in to comment.