summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/nvgpu_common.c
diff options
context:
space:
mode:
authorDavid Nieto <dmartineznie@nvidia.com>2017-02-13 14:22:59 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-20 19:39:55 -0400
commit74fe1caa2b56aab24c17ad4dd2524128fc237894 (patch)
tree0793bb92b67d64690658f3f7cd1a8e1ea93206ba /drivers/gpu/nvgpu/common/nvgpu_common.c
parent469308becaff326da02fcf791e803e812e1cf9f8 (diff)
gpu: nvgpu: Add refcounting to driver fds
The main driver structure is not refcounted properly, so when the driver unload, file desciptors associated to the driver are kept open with dangling references to the main object. This change adds referencing to the gk20a structure. bug 200277762 JIRA: EVLR-1023 Change-Id: Id892e9e1677a344789e99bf649088c076f0bf8de Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: http://git-master/r/1317420 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/nvgpu_common.c')
-rw-r--r--drivers/gpu/nvgpu/common/nvgpu_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/nvgpu_common.c b/drivers/gpu/nvgpu/common/nvgpu_common.c
index 16640aa6..f1109684 100644
--- a/drivers/gpu/nvgpu/common/nvgpu_common.c
+++ b/drivers/gpu/nvgpu/common/nvgpu_common.c
@@ -172,6 +172,8 @@ int nvgpu_probe(struct gk20a *g,
172 172
173 g->remove_support = gk20a_remove_support; 173 g->remove_support = gk20a_remove_support;
174 174
175 kref_init(&g->refcount);
176
175 return 0; 177 return 0;
176} 178}
177 179