From dcd3778b5ea4e01ab1e5d2dab2b087b8da67b21e Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 31 Dec 2018 20:07:11 +0530 Subject: [PATCH] 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 Reviewed-by: svc-mobile-coverity Reviewed-by: Konsta Holtta Reviewed-by: svc-mobile-misra Reviewed-by: Nitin Kumbhar Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 44b8cc01b..f833a1219 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -1717,8 +1717,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);