diff options
| author | Jesse Zhang <[email protected]> | 2024-05-29 09:29:01 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-06-05 14:58:36 +0000 |
| commit | c09d2eff81a997c169e0cacacd6b60c5e3aa33f2 (patch) | |
| tree | 031ce40e6ac513d4fcd18330e77db880bd21873b /drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | |
| parent | drm/amdgpu: Update programming for boot error reporting (diff) | |
| download | kernel-c09d2eff81a997c169e0cacacd6b60c5e3aa33f2.tar.gz kernel-c09d2eff81a997c169e0cacacd6b60c5e3aa33f2.zip | |
drm/amdgu: fix Unintentional integer overflow for mall size
Potentially overflowing expression mall_size_per_umc * adev->gmc.num_umc with type unsigned int (32 bits, unsigned)
is evaluated using 32-bit arithmetic,and then used in a context that expects an expression of type u64 (64 bits, unsigned).
Signed-off-by: Jesse Zhang <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index 87b31ed8de19..c71356cb393d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -1629,7 +1629,7 @@ static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev) break; case 2: mall_size_per_umc = le32_to_cpu(mall_info->v2.mall_size_per_umc); - adev->gmc.mall_size = mall_size_per_umc * adev->gmc.num_umc; + adev->gmc.mall_size = (uint64_t)mall_size_per_umc * adev->gmc.num_umc; break; default: dev_err(adev->dev, |
