From 7ed189de4456d26697f44b836f8002147a294c4b Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Fri, 7 Jun 2019 12:29:07 -0700 Subject: [PATCH] gpu: nvgpu: fix CERT INT30-C in common.gr.falcon Fixed CERT C error by using nvgpu_gr_checksum_u32: segments->boot_signature += bootimage[i]; --> segments->boot_signature = nvgpu_gr_checksum_u32( segments->boot_signature, bootimage[i]); JIRA NVGPU-3622 Change-Id: I01de116ba2a8afacb8a93be7b88e356a48122c5a Signed-off-by: Seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/2132547 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/gr_falcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/gr/gr_falcon.c b/drivers/gpu/nvgpu/common/gr/gr_falcon.c index 10ed4e83b..801309c3d 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_falcon.c +++ b/drivers/gpu/nvgpu/common/gr/gr_falcon.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef CONFIG_NVGPU_LS_PMU #include #include @@ -273,7 +274,8 @@ static int nvgpu_gr_falcon_copy_ctxsw_ucode_segments( /* compute a "checksum" for the boot binary to detect its version */ segments->boot_signature = 0; for (i = 0; i < segments->boot.size / sizeof(u32); i++) { - segments->boot_signature += bootimage[i]; + segments->boot_signature = nvgpu_gr_checksum_u32( + segments->boot_signature, bootimage[i]); } return 0;