summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2018-01-03 09:28:47 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-04 11:46:10 -0500
commite0aca109b1d98ca4ddb42ac42a60b0f267f1ecf5 (patch)
treebfe3eacf10ae30fb9e06af9848e771ab5f161ce3 /drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
parentc7b7dbe39a598aa228e4aaea4aec3ce958a27187 (diff)
gpu: nvgpu: fix erroneous gk20a_put() call
With a recent rework we moved gk20a_get() call to nvgpu_ioctl_tsg_open(), but corresponding gk20a_put() call remained in gk20a_tsg_release() So if a TSG is opened and released from within kernel with APIs gk20a_tsg_open()/gk20a_tsg_release() we mistakenly drop extra refcount through gk20a_put() Fix this by moving gk20a_put() call to nvgpu_ioctl_tsg_release() which balances gk20a_get() call in nvgpu_ioctl_tsg_open() Bug 200374011 Change-Id: Id0cec0426e6231309dc530ab5c934dacaba9f8da Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1630969 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/gpu/nvgpu/gk20a/tsg_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
index ff700372..d9ddc011 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c
@@ -347,7 +347,6 @@ void gk20a_tsg_release(struct nvgpu_ref *ref)
347 tsg->runlist_id = ~0; 347 tsg->runlist_id = ~0;
348 348
349 gk20a_dbg(gpu_dbg_fn, "tsg released %d\n", tsg->tsgid); 349 gk20a_dbg(gpu_dbg_fn, "tsg released %d\n", tsg->tsgid);
350 gk20a_put(g);
351} 350}
352 351
353struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch) 352struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch)