[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1301320607-7259-6-git-send-email-namhyung@gmail.com>
Date: Mon, 28 Mar 2011 22:56:46 +0900
From: Namhyung Kim <namhyung@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Paul Mundt <lethal@...ux-sh.org>,
David Howells <dhowells@...hat.com>,
Greg Ungerer <gerg@...pgear.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 5/6] nommu: fix a potential memory leak in do_mmap_private()
If f_op->read() fails and sysctl_nr_trim_pages > 1, there could be a
memory leak between @region->vm_end and @region->vm_top.
Signed-off-by: Namhyung Kim <namhyung@...il.com>
---
mm/nommu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index 33f5d23c6d44..662fd46449a6 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1241,7 +1241,7 @@ static int do_mmap_private(struct vm_area_struct *vma,
return 0;
error_free:
- free_page_series(region->vm_start, region->vm_end);
+ free_page_series(region->vm_start, region->vm_top);
region->vm_start = vma->vm_start = 0;
region->vm_end = vma->vm_end = 0;
region->vm_top = 0;
--
1.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists