diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 93e3cc581b51..51772df1abc5 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5639,7 +5639,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma, { struct page *page = vm_normal_page(vma, addr, ptent); - if (!page || !page_mapped(page)) + if (!page) return NULL; if (PageAnon(page)) { if (!(mc.flags & MOVE_ANON)) @@ -5648,8 +5648,7 @@ static struct page *mc_handle_present_pte(struct vm_area_struct *vma, if (!(mc.flags & MOVE_FILE)) return NULL; } - if (!get_page_unless_zero(page)) - return NULL; + get_page(page); return page; }