All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hugetlb: release pages in the error path of hugetlb_cow()
@ 2011-11-11 13:01 ` Hillf Danton
  0 siblings, 0 replies; 8+ messages in thread
From: Hillf Danton @ 2011-11-11 13:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andrea Arcangeli, Hugh Dickins, Johannes Weiner, LKML, linux-mm

If fail to prepare anon_vma, {new, old}_page should be released, or they will
escape the track and/or control of memory management.

Thanks

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/mm/hugetlb.c	Fri Nov 11 20:36:32 2011
+++ b/mm/hugetlb.c	Fri Nov 11 20:43:06 2011
@@ -2422,6 +2422,8 @@ retry_avoidcopy:
 	 * anon_vma prepared.
 	 */
 	if (unlikely(anon_vma_prepare(vma))) {
+		page_cache_release(new_page);
+		page_cache_release(old_page);
 		/* Caller expects lock to be held */
 		spin_lock(&mm->page_table_lock);
 		return VM_FAULT_OOM;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-11-21  8:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-11 13:01 [PATCH] hugetlb: release pages in the error path of hugetlb_cow() Hillf Danton
2011-11-11 13:01 ` Hillf Danton
2011-11-11 17:23 ` Andrea Arcangeli
2011-11-11 17:23   ` Andrea Arcangeli
2011-11-15 15:38 ` Michal Hocko
2011-11-15 15:38   ` Michal Hocko
2011-11-21  8:12 ` Johannes Weiner
2011-11-21  8:12   ` Johannes Weiner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.