summaryrefslogtreecommitdiff
path: root/arch/mips/mm/umap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/umap.c')
-rw-r--r--arch/mips/mm/umap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/mips/mm/umap.c b/arch/mips/mm/umap.c
index 8b9a4cac7857..e053fb5ef8ee 100644
--- a/arch/mips/mm/umap.c
+++ b/arch/mips/mm/umap.c
@@ -116,8 +116,12 @@ void *vmalloc_uncached (unsigned long size)
static inline void free_pte(pte_t page)
{
if (pte_present(page)) {
- struct page *ptpage = pte_page(page);
- if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage))
+ unsigned long pfn = pte_pfn(page);
+ struct page *ptpage;
+ if (!pfn_valid(pfn))
+ return;
+ ptpage = pfn_to_page(pfn);
+ if (PageReserved(ptpage))
return;
__free_page(ptpage);
if (current->mm->rss <= 0)