From df7631efc8c8775db262f654ecb56bd98d1e5509 Mon Sep 17 00:00:00 2001 From: vinodg Date: Fri, 17 Jan 2020 13:49:05 -0800 Subject: [PATCH] gpu: nvgpu: correct the gr.config unit test for invalid pes Remove changing the gpc_count to 2. This could result in memory access error for struct whose allocation happens during init call. For igpu, no need to check for higher gpc_count. Jira NVGPU-4531 Change-Id: I48ad60b083d91fd2f8a673fb8fabbe48e171912e Signed-off-by: vinodg Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2280706 Reviewed-by: Philip Elcan Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- userspace/units/gr/config/nvgpu-gr-config.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/userspace/units/gr/config/nvgpu-gr-config.c b/userspace/units/gr/config/nvgpu-gr-config.c index 9bb6682d8..4694051f2 100644 --- a/userspace/units/gr/config/nvgpu-gr-config.c +++ b/userspace/units/gr/config/nvgpu-gr-config.c @@ -433,14 +433,11 @@ static int gr_test_invalid_pes_with_sm_id(struct gk20a *g, /* Set pes tpc mask same */ u32 pes_tpc_mask = gr_conf->pes_tpc_mask[1][0]; - u32 gpc_count = nvgpu_gr_config_get_gpc_count(gr_conf); gr_conf->pes_tpc_mask[1][0] = gr_conf->pes_tpc_mask[0][0]; - gr_conf->gpc_count = 2; err = g->ops.gr.config.init_sm_id_table(g, gr_conf); gr_conf->pes_tpc_mask[1][0] = pes_tpc_mask; - gr_conf->gpc_count = gpc_count; return err; }