summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-06-05 01:56:59 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:05 -0400
commitccbe6c44d32578ef4b5e15cfcc61f9dc86702c6b (patch)
tree11e199085355a215a5d3cf97d24335b6ba909d04 /drivers
parent6b33379c55a8368ce9e5ed1381f9aeeebe383dfe (diff)
gpu: nvgpu: fix memory leak of dbg_session
In gk20a_dbg_gpu_dev_release() (when we close nvhost-dgb-gpu sysfs), we return from function if there is no channel bound to dbg_session without freeing the dbg_session memory. If there is no channel bound then do not call dbg_unbind_channel_gk20a() and then free dbg_session memory always. Bug 200010382 Change-Id: I90dd2ed3cd72fbc5d429799660daf2a09b974fda Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/419306 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index 77806a5e..7a1140f9 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -299,9 +299,8 @@ int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp)
299 gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", dev_name(dbg_s->dev)); 299 gk20a_dbg(gpu_dbg_gpu_dbg | gpu_dbg_fn, "%s", dev_name(dbg_s->dev));
300 300
301 /* unbind if it was bound */ 301 /* unbind if it was bound */
302 if (!dbg_s->ch) 302 if (dbg_s->ch)
303 return 0; 303 dbg_unbind_channel_gk20a(dbg_s);
304 dbg_unbind_channel_gk20a(dbg_s);
305 304
306 kfree(dbg_s); 305 kfree(dbg_s);
307 return 0; 306 return 0;