summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2015-05-15 08:29:59 -0400
committerSachin Nikam <snikam@nvidia.com>2015-05-19 23:32:38 -0400
commit4531a27adcc5629d1e246af5b0a5ca378daca9d1 (patch)
tree6706eae51c587a2a7e153261dcb131da5a4f1a77 /drivers
parent01f359f3f1bbf95d7ac4453a6c1de811bf0aee11 (diff)
gpu: nvgpu: fix channel leak with immediate close
If a GPU channel is closed immediately after opening without performing any operation on it, we leak that channel e.g. below command leaks a channel echo > /dev/nvhost-gpu Fix this leak by releasing the channel before returning Change-Id: I2598e3cabec6996cb1cf8066a1e6d7d5864ae02b Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/743235 (cherry picked from commit 428771509b4431ebe88e38061b495cabc5192327) Reviewed-on: http://git-master/r/744279 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 5691a7cd..f311a91a 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -577,7 +577,7 @@ void gk20a_free_channel(struct channel_gk20a *ch, bool finish)
577 mutex_unlock(&f->deferred_reset_mutex); 577 mutex_unlock(&f->deferred_reset_mutex);
578 578
579 if (!ch->bound) 579 if (!ch->bound)
580 return; 580 goto release;
581 581
582 if (!gk20a_channel_as_bound(ch)) 582 if (!gk20a_channel_as_bound(ch))
583 goto unbind; 583 goto unbind;
@@ -652,6 +652,7 @@ unbind:
652 652
653 mutex_unlock(&ch->dbg_s_lock); 653 mutex_unlock(&ch->dbg_s_lock);
654 654
655release:
655 /* ALWAYS last */ 656 /* ALWAYS last */
656 release_used_channel(f, ch); 657 release_used_channel(f, ch);
657} 658}