diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2013-03-15 14:50:50 +0200 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2013-04-03 23:22:21 -0700 |
commit | bcdfae6c15ef90730ef377ae7aac2a3f369436f4 (patch) | |
tree | 6a1dbf76f286121feac09dcdc98252c0d319cf96 /drivers/video/tegra/nvmap/nvmap.c | |
parent | 827e9f4eca84f243d3187bd522d4bd0b538513de (diff) |
video: tegra: nvmap: Unpin memory on errors
This patch adds a missing handle_unpin() calls to nvmap_pin_ids() and
_nvmap_pin() error paths.
Bug 1246095
Bug 1263718
Change-Id: I6b8e632aa8d90f2436cfbaad8015e11527c6da83
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/210009
(cherry picked from commit 68e43a5aa350eff1c66f0020fbdd189f085cce58)
Reviewed-on: http://git-master/r/215467
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Sandeep Shinde <sashinde@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap.c')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index e5d829b3d05d..4e84c05dab48 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -594,12 +594,15 @@ phys_addr_t _nvmap_pin(struct nvmap_client *client, if (h->heap_pgalloc && h->pgalloc.dirty) ret = map_iovmm_area(h); if (ret) - goto err_out; + goto err_out_unpin; phys = handle_phys(h); } return phys; +err_out_unpin: + nvmap_handle_get(h); + handle_unpin(client, h, true); err_out: atomic_dec(&ref->pin); nvmap_handle_put(h); |