hugetlb: release pages in the error path of hugetlb_cow()
authorHillf Danton <dhillf@gmail.com>
Tue, 15 Nov 2011 22:36:12 +0000 (14:36 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Dec 2011 16:54:31 +0000 (08:54 -0800)
commitd3b2937da9fc51f48ae77735e78be53a8a4c0ae4
tree105a72d518e1c01acedf6b8445770ce17868fd44
parent6d10c223ab5a75fa961019fa91fc811128cb876b
hugetlb: release pages in the error path of hugetlb_cow()

commit ea4039a34c4c206d015d34a49d0b00868e37db1d upstream.

If we fail to prepare an anon_vma, the {new, old}_page should be released,
or they will leak.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <jweiner@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/hugetlb.c