mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
drm/amdgpu: add bounds check to prevent array overflow
Add bounds check to prevent array overflow. v2: Add warning messages. Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a63e82d499
commit
db15c49a17
|
|
@ -5064,6 +5064,13 @@ static void amdgpu_register_bad_pages_mca_notifier(struct amdgpu_device *adev)
|
|||
* Use this list instead of mgpu_info to find the amdgpu
|
||||
* device on which the UMC error was reported.
|
||||
*/
|
||||
if (mce_adev_list.num_gpu >= MAX_GPU_INSTANCE) {
|
||||
dev_warn_ratelimited(adev->dev,
|
||||
"mce_adev_list full, skip notifier registration (max=%d)\n",
|
||||
MAX_GPU_INSTANCE);
|
||||
return;
|
||||
}
|
||||
|
||||
mce_adev_list.devs[mce_adev_list.num_gpu++] = adev;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user