mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: Prevent integer overflow of GPU config
In CDE GPU CONFIGURATION the result is computed using 32-bit arithmetic and returned as 64-bit unsigned integer. Cast intermediate result to u64 to prevent unintentional overflow. Change-Id: Iebe53e2b17c1aaa498245a52962c3dbad7ce893e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1249962 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Seema Khowala <seemaj@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
d09d259d74
commit
f6ab3c7cfe
@@ -374,7 +374,7 @@ static int gk20a_cde_patch_params(struct gk20a_cde_ctx *cde_ctx)
|
||||
new_data = g->gr.comptags_per_cacheline;
|
||||
break;
|
||||
case TYPE_PARAM_GPU_CONFIGURATION:
|
||||
new_data = g->ltc_count * g->gr.slices_per_ltc *
|
||||
new_data = (u64)g->ltc_count * g->gr.slices_per_ltc *
|
||||
g->gr.cacheline_size;
|
||||
break;
|
||||
case TYPE_PARAM_FIRSTPAGEOFFSET:
|
||||
|
||||
Reference in New Issue
Block a user