Files
linux-nvgpu/drivers/gpu/nvgpu/os/linux/cde.c
Jinesh Parakh e3ed309d35 gpu: nvgpu: Fix Unintentional integer overflow bug
Fix following Coverity defect:
cde.c : Unintentional integer overflow

The Coverity issue suggests that (u64) (nvgpu_ltc_get_ltc_count(g) * nvgpu_ltc_get_slices_per_ltc(g) * nvgpu_ltc_get_cacheline_size(g)) can cause overflow because typecasting is done after multiplication.
This patch solves that issue by typecasting it before multiplication.

CID 10112360

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I314ca7a9adc95fcb09f15eb603b56ad03ce34b99
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2697027
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-04-29 06:11:31 -07:00

51 KiB