Commit 5addc565 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] do_no_page leak fix

We leak a page in do_no_page() if pte_chain_alloc fails.
parent 43807a0e
......@@ -1433,10 +1433,8 @@ do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
*/
if (write_access && !(vma->vm_flags & VM_SHARED)) {
struct page * page = alloc_page(GFP_HIGHUSER);
if (!page) {
page_cache_release(new_page);
if (!page)
goto oom;
}
copy_user_highpage(page, new_page, address);
page_cache_release(new_page);
lru_cache_add_active(page);
......@@ -1493,6 +1491,7 @@ do_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
spin_unlock(&mm->page_table_lock);
goto out;
oom:
page_cache_release(new_page);
ret = VM_FAULT_OOM;
out:
pte_chain_free(pte_chain);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment