提交 a970a976 编写于 作者: M Matthew Wilcox (Oracle) 提交者: David S. Miller

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: NMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: NDavid Hildenbrand <david@redhat.com>
Reviewed-by: NMike Rapoport <rppt@linux.ibm.com>
Acked-by: NVlastimil Babka <vbabka@suse.cz>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 80bddf5c
...@@ -2899,7 +2899,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm) ...@@ -2899,7 +2899,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
if (!page) if (!page)
return NULL; return NULL;
if (!pgtable_pte_page_ctor(page)) { if (!pgtable_pte_page_ctor(page)) {
free_unref_page(page); __free_page(page);
return NULL; return NULL;
} }
return (pte_t *) page_address(page); return (pte_t *) page_address(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册