summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenjchen <kenjchen@nvidia.com>2011-06-08 15:18:27 +0800
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-23 23:46:34 -0700
commit10a1f5547cbee156c6485b1e2d30b77ec3065c0f (patch)
treef45eb4bc747e0fa9bca566309be419249888d7ba
parentf6a0c19eee9c0ac0a7de0ed623f39814a9471569 (diff)
video: tegra: nvmap: free vm_struct in nvmap_munmap()
In nvmap_munmap(), remove_vm_area just remove the allocated memory page information. It doesn't de-allocate vm_struct. kfree() should be used to avoid memory leak in nvmap. Bug: 833796 Change-Id: Ibd0309c1ff323fb8110870ace27819f5a1e006ba Reviewed-on: http://git-master/r/35638 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com>
-rw-r--r--drivers/video/tegra/nvmap/nvmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c
index 532b39f20cea..3d3a79450028 100644
--- a/drivers/video/tegra/nvmap/nvmap.c
+++ b/drivers/video/tegra/nvmap/nvmap.c
@@ -27,6 +27,7 @@
#include <linux/smp_lock.h>
#include <linux/vmalloc.h>
#include <linux/wait.h>
+#include <linux/slab.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
@@ -698,6 +699,7 @@ void nvmap_munmap(struct nvmap_handle_ref *ref, void *addr)
addr -= (h->carveout->base & ~PAGE_MASK);
vm = remove_vm_area(addr);
BUG_ON(!vm);
+ kfree(vm);
nvmap_usecount_dec(h);
}
nvmap_handle_put(h);