summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-08 17:29:14 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-11 14:47:42 -0500
commit8fa5e7c58ac08fdb2432a4791595278d69827fb0 (patch)
tree18d76c47d66d314206315f1d81adcf8513872d09 /drivers/gpu/nvgpu/vgpu
parente580e68f2374b3a0b6226eac7fc4e21dbdcbf22c (diff)
gpu: nvgpu: Remove IOCTL FREE_OBJ_CTX
We have never used the IOCTL FREE_OBJ_CTX. Using it leads to context being only partially available, and can lead to use-after-free. Bug 1834225 Change-Id: I9d2b632ab79760f8186d02e0f35861b3a6aae649 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1250004 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index 89223091..01f5e1a5 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -421,7 +421,6 @@ static void vgpu_gr_free_channel_ctx(struct channel_gk20a *c)
421 421
422 memset(&c->ch_ctx, 0, sizeof(struct channel_ctx_gk20a)); 422 memset(&c->ch_ctx, 0, sizeof(struct channel_ctx_gk20a));
423 423
424 c->num_objects = 0;
425 c->first_init = false; 424 c->first_init = false;
426} 425}
427 426
@@ -586,8 +585,6 @@ static int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c,
586 c->first_init = true; 585 c->first_init = true;
587 } 586 }
588 587
589 c->num_objects++;
590
591 gk20a_dbg_fn("done"); 588 gk20a_dbg_fn("done");
592 return 0; 589 return 0;
593out: 590out:
@@ -599,24 +596,6 @@ out:
599 return err; 596 return err;
600} 597}
601 598
602static int vgpu_gr_free_obj_ctx(struct channel_gk20a *c,
603 struct nvgpu_free_obj_ctx_args *args)
604{
605 gk20a_dbg_fn("");
606
607 if (c->num_objects == 0)
608 return 0;
609
610 c->num_objects--;
611
612 if (c->num_objects == 0) {
613 c->first_init = false;
614 gk20a_disable_channel(c);
615 }
616
617 return 0;
618}
619
620static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) 599static int vgpu_gr_init_gr_config(struct gk20a *g, struct gr_gk20a *gr)
621{ 600{
622 struct vgpu_priv_data *priv = vgpu_get_priv_data(g); 601 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
@@ -1073,7 +1052,6 @@ void vgpu_init_gr_ops(struct gpu_ops *gops)
1073 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch; 1052 gops->gr.detect_sm_arch = vgpu_gr_detect_sm_arch;
1074 gops->gr.free_channel_ctx = vgpu_gr_free_channel_ctx; 1053 gops->gr.free_channel_ctx = vgpu_gr_free_channel_ctx;
1075 gops->gr.alloc_obj_ctx = vgpu_gr_alloc_obj_ctx; 1054 gops->gr.alloc_obj_ctx = vgpu_gr_alloc_obj_ctx;
1076 gops->gr.free_obj_ctx = vgpu_gr_free_obj_ctx;
1077 gops->gr.alloc_gr_ctx = vgpu_gr_alloc_gr_ctx; 1055 gops->gr.alloc_gr_ctx = vgpu_gr_alloc_gr_ctx;
1078 gops->gr.free_gr_ctx = vgpu_gr_free_gr_ctx; 1056 gops->gr.free_gr_ctx = vgpu_gr_free_gr_ctx;
1079 gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull; 1057 gops->gr.bind_ctxsw_zcull = vgpu_gr_bind_ctxsw_zcull;