mm: nommu: fix a potential memory leak in do_mmap_private()
authorNamhyung Kim <namhyung@gmail.com>
Wed, 25 May 2011 00:11:26 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 25 May 2011 15:39:06 +0000 (08:39 -0700)
commit7223bb4a829628bdf37d544ed4363d99bac1ade6
tree4c300b6753a2346d24503e3d3d8f4a699758d21f
parentd75a310c42c616c168953ed45c1091074f97828c
mm: 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@gmail.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/nommu.c