Skip to content

Commit 43aedbf

Browse files
Stanley.Yangalexdeucher
authored andcommitted
drm/amdgpu: Add checking mc_vram_size
Do not compare injection address with mc_vram_size if mc_vram_size is zero. Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 38298ce commit 43aedbf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f,
489489
ret = amdgpu_ras_feature_enable(adev, &data.head, 1);
490490
break;
491491
case 2:
492-
if ((data.inject.address >= adev->gmc.mc_vram_size) ||
492+
if ((data.inject.address >= adev->gmc.mc_vram_size &&
493+
adev->gmc.mc_vram_size) ||
493494
(data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) {
494495
dev_warn(adev->dev, "RAS WARN: input address "
495496
"0x%llx is invalid.",

0 commit comments

Comments
 (0)