diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-11-08 16:13:43 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-11 11:20:34 -0500 |
commit | f6ab3c7cfeb22120d786f588b0dc380a238d13d3 (patch) | |
tree | e7c7249b4ca73051f2078a9eacc259ce3aa8c6cd /drivers/gpu/nvgpu/gk20a | |
parent | d09d259d74d229bb22e3440ab0660ecd66f94250 (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 17453489..8b3d0dfa 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -374,7 +374,7 @@ static int gk20a_cde_patch_params(struct gk20a_cde_ctx *cde_ctx) | |||
374 | new_data = g->gr.comptags_per_cacheline; | 374 | new_data = g->gr.comptags_per_cacheline; |
375 | break; | 375 | break; |
376 | case TYPE_PARAM_GPU_CONFIGURATION: | 376 | case TYPE_PARAM_GPU_CONFIGURATION: |
377 | new_data = g->ltc_count * g->gr.slices_per_ltc * | 377 | new_data = (u64)g->ltc_count * g->gr.slices_per_ltc * |
378 | g->gr.cacheline_size; | 378 | g->gr.cacheline_size; |
379 | break; | 379 | break; |
380 | case TYPE_PARAM_FIRSTPAGEOFFSET: | 380 | case TYPE_PARAM_FIRSTPAGEOFFSET: |