diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-12-07 17:40:45 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-12-19 18:40:30 -0500 |
commit | cee118c1d449793d925231e8ea3bb34558e9c020 (patch) | |
tree | 4d76ebf5850f453d53a47919f6d1375c3dbdab82 /drivers/gpu/nvgpu/gk20a | |
parent | b018428c166959c99f045a70db87a42a4e061fed (diff) |
gpu: nvgpu: Fix memory leaks
Fix a memory leak introduced when making the priv struct for
TSGs.
Fix another memory leak when introducing a priv struct for
channels.
Bug 1816516
Change-Id: I7b0e62bb6352f7e65acb5501cab9cef055d1f535
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1266889
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 40766857..129921ad 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1183,6 +1183,7 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) | |||
1183 | gk20a_channel_close(ch); | 1183 | gk20a_channel_close(ch); |
1184 | gk20a_idle(g->dev); | 1184 | gk20a_idle(g->dev); |
1185 | 1185 | ||
1186 | kfree(filp->private_data); | ||
1186 | filp->private_data = NULL; | 1187 | filp->private_data = NULL; |
1187 | return 0; | 1188 | return 0; |
1188 | } | 1189 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index 181140d2..0541f430 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -517,6 +517,7 @@ int gk20a_tsg_dev_release(struct inode *inode, struct file *filp) | |||
517 | return -ENODEV; | 517 | return -ENODEV; |
518 | 518 | ||
519 | kref_put(&tsg->refcount, gk20a_tsg_release); | 519 | kref_put(&tsg->refcount, gk20a_tsg_release); |
520 | kfree(priv); | ||
520 | return 0; | 521 | return 0; |
521 | } | 522 | } |
522 | 523 | ||