mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
drm/amdgu: fix Unintentional integer overflow for mall size
[ Upstream commit c09d2eff81
]
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 <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
69f397e60c
commit
54a11ce4ff
|
@ -1550,7 +1550,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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user