semc7x30/msm7x30-3.4.x-nAa — pull request #1 by shenlong (2013-05-17 04:47:49+00:00)
Title: Update hugetlb.c

hugetlb: fix resv_map leak in error path
from:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c50ac050811d6485616a193eb0f37bfbd191cc89
When called for anonymous (non-shared) mappings, hugetlb_reserve_pages()
does a resv_map_alloc(). It depends on code in hugetlbfs's
vm_ops->close() to release that allocation.

However, in the mmap() failure path, we do a plain unmap_region() without
the remove_vma() which actually calls vm_ops->close().

This is a decent fix. This leak could get reintroduced if new code (say,
after hugetlb_reserve_pages() in hugetlbfs_file_mmap()) decides to return
an error. But, I think it would have to unroll the reservation anyway.