diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-01-02 05:04:06 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-04 11:45:48 -0500 |
commit | 5ad1c28b5fa7724e7aa65ea1a87a615c0d5408f6 (patch) | |
tree | a10d951686ae24da73efee885dced32e42811db2 /drivers | |
parent | 292e4a0c6dc8ba2066c41e9215e731861ea2dbef (diff) |
gpu: nvgpu: fix TSG leak from CE code
In gk20a_ce_delete_gpu_context(), we unbind the channel from TSG and
close the channel. But we do not drop the TSG refcount leaking
the TSG reference
Fix this by explicitly dropping TSG refcount
Also, do not explicitly unbind the channel from TSG
gk20a_channel_close() will internally unbind the channel from TSG
Bug 200374011
Change-Id: Ie4aa32f1d0bff4231f41aa2b33743cdc63e967c7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1629972
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index ec20a679..99a6dd1b 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c | |||
@@ -153,13 +153,12 @@ static void gk20a_ce_delete_gpu_context(struct gk20a_gpu_ctx *ce_ctx) | |||
153 | nvgpu_dma_unmap_free(ce_ctx->vm, &ce_ctx->cmd_buf_mem); | 153 | nvgpu_dma_unmap_free(ce_ctx->vm, &ce_ctx->cmd_buf_mem); |
154 | } | 154 | } |
155 | 155 | ||
156 | /* unbind tsg */ | 156 | /* |
157 | if (ce_ctx->tsg && ce_ctx->ch) | 157 | * free the channel |
158 | gk20a_tsg_unbind_channel(ce_ctx->ch); | 158 | * gk20a_channel_close() will also unbind the channel from TSG |
159 | 159 | */ | |
160 | /* free the channel */ | 160 | gk20a_channel_close(ce_ctx->ch); |
161 | if (ce_ctx->ch) | 161 | nvgpu_ref_put(&ce_ctx->tsg->refcount, gk20a_tsg_release); |
162 | gk20a_channel_close(ce_ctx->ch); | ||
163 | 162 | ||
164 | /* housekeeping on app */ | 163 | /* housekeeping on app */ |
165 | if (list->prev && list->next) | 164 | if (list->prev && list->next) |