summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2012-05-29 18:30:16 +0300
committerRyan Wong <ryanw@nvidia.com>2012-06-07 13:28:24 -0700
commit22a1bf6884e9fcb495f22090f561c1a9a5758775 (patch)
tree90fc4870df83082f1e5a24d92b2b33c6e91f82fa
parent2ff464b8dcd9681e86d361d55ce2558e8f55aec7 (diff)
video: tegra: host: Fix error case memory leaks
When a submit fails, the related nvhost_job is not freed. Add an explicit free. Also, 3D is mapping the save buffer, but it is not unmapped. Bug 991972 Change-Id: Ie335adb5e64f54557e76d12dfb6a9a1557781e8d Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/106871 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Ryan Wong <ryanw@nvidia.com> Tested-by: Ryan Wong <ryanw@nvidia.com>
-rw-r--r--drivers/video/tegra/host/bus_client.c5
-rw-r--r--drivers/video/tegra/host/gr3d/gr3d_t30.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c
index 822f8f3a456d..e238844b1ad9 100644
--- a/drivers/video/tegra/host/bus_client.c
+++ b/drivers/video/tegra/host/bus_client.c
@@ -188,6 +188,11 @@ static void reset_submit(struct nvhost_channel_userctx *ctx)
ctx->hdr.num_relocs = 0;
ctx->num_relocshifts = 0;
ctx->hdr.num_waitchks = 0;
+
+ if (ctx->job) {
+ nvhost_job_put(ctx->job);
+ ctx->job = NULL;
+ }
}
static ssize_t nvhost_channelwrite(struct file *filp, const char __user *buf,
diff --git a/drivers/video/tegra/host/gr3d/gr3d_t30.c b/drivers/video/tegra/host/gr3d/gr3d_t30.c
index 57f4c779eff8..4bc7c9f92bb5 100644
--- a/drivers/video/tegra/host/gr3d/gr3d_t30.c
+++ b/drivers/video/tegra/host/gr3d/gr3d_t30.c
@@ -427,6 +427,8 @@ struct nvhost_hwctx_handler *nvhost_gr3d_t30_ctxhandler_init(
setup_save(p, save_ptr);
+ nvmap_munmap(p->save_buf, save_ptr);
+
p->h.alloc = ctx3d_alloc_v1;
p->h.save_push = save_push_v1;
p->h.save_service = NULL;