Commit a970a976 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by David S. Miller
Browse files

sparc: Fix handling of page table constructor failure



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: 1ae9ae5f ("sparc: handle pgtable_page_ctor() fail")
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80bddf5c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);