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:
Terje Bergstrom
2016-11-08 13:13:43 -08:00
committed by mobile promotions
parent d09d259d74
commit f6ab3c7cfe

View File

@@ -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: