From f1be222687a853b0218a5700a213f3d34d8ccc4f Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 31 Dec 2018 20:07:11 +0530 Subject: gpu: nvgpu: fix invalid TSG pointer In gr_gp10b_set_cilp_preempt_pending() we already extract TSG pointer by calling tsg_gk20a_from_ch() which safely returns correct TSG or NULL in error case But before calling g->ops.fifo.post_event_id() we again extract TSG by directly accessing g->fifo.tsg array, and this could result in getting invalid TSG pointer Fix this by removing direct TSG extraction through g->fifo.tsg Bug 2444819 Jira NVGPU-1601 Change-Id: I9d49b5309c74e162828e7cb7d97556aae939a07c Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1984954 (cherry picked from commit dcd3778b5ea4e01ab1e5d2dab2b087b8da67b21e) Reviewed-on: https://git-master.nvidia.com/r/2077313 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 4d7c6d69..4b42678f 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -1801,8 +1801,6 @@ int gr_gp10b_set_cilp_preempt_pending(struct gk20a *g, gr_ctx->cilp_preempt_pending = true; g->gr.cilp_preempt_pending_chid = fault_ch->chid; - tsg = &g->fifo.tsg[fault_ch->tsgid]; - g->ops.fifo.post_event_id(tsg, NVGPU_EVENT_ID_CILP_PREEMPTION_STARTED); -- cgit v1.2.2