From 8fa5e7c58ac08fdb2432a4791595278d69827fb0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 8 Nov 2016 14:29:14 -0800 Subject: 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 Reviewed-on: http://git-master/r/1250004 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 0e8c1884..e6103479 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -2957,7 +2957,6 @@ void gk20a_free_channel_ctx(struct channel_gk20a *c) memset(&c->ch_ctx, 0, sizeof(struct channel_ctx_gk20a)); - c->num_objects = 0; c->first_init = false; } @@ -3169,8 +3168,6 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, c->first_init = true; } - c->num_objects++; - gk20a_dbg_fn("done"); return 0; out: @@ -3182,25 +3179,6 @@ out: return err; } -int gk20a_free_obj_ctx(struct channel_gk20a *c, - struct nvgpu_free_obj_ctx_args *args) -{ - gk20a_dbg_fn(""); - - if (c->num_objects == 0) - return 0; - - c->num_objects--; - - if (c->num_objects == 0) { - c->first_init = false; - gk20a_disable_channel(c); - gr_gk20a_free_channel_patch_ctx(c); - } - - return 0; -} - int gk20a_comptag_allocator_init(struct gk20a_comptag_allocator *allocator, unsigned long size) { @@ -9082,7 +9060,6 @@ void gk20a_init_gr_ops(struct gpu_ops *gops) gops->gr.get_gpc_tpc_mask = gr_gk20a_get_gpc_tpc_mask; gops->gr.free_channel_ctx = gk20a_free_channel_ctx; gops->gr.alloc_obj_ctx = gk20a_alloc_obj_ctx; - gops->gr.free_obj_ctx = gk20a_free_obj_ctx; gops->gr.bind_ctxsw_zcull = gr_gk20a_bind_ctxsw_zcull; gops->gr.get_zcull_info = gr_gk20a_get_zcull_info; gops->gr.is_tpc_addr = gr_gk20a_is_tpc_addr; -- cgit v1.2.2