[AMD Official Use Only - General] With my concerns fixed, the series is: Reviewed-by: Tao Zhou <tao.zhou1@xxxxxxx> > -----Original Message----- > From: Stanley.Yang <Stanley.Yang@xxxxxxx> > Sent: Tuesday, June 13, 2023 11:53 AM > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Zhang, Hawking <Hawking.Zhang@xxxxxxx>; > Zhou1, Tao <Tao.Zhou1@xxxxxxx> > Cc: Yang, Stanley <Stanley.Yang@xxxxxxx> > Subject: [PATCH Review 2/2] 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@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > index 56bb0db207b9..3c041efcf0c4 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > @@ -494,7 +494,8 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file > *f, > ret = amdgpu_ras_feature_enable(adev, &data.head, 1); > break; > case 2: > - if ((data.inject.address >= adev->gmc.mc_vram_size) || > + if ((data.inject.address >= adev->gmc.mc_vram_size && > + adev->gmc.mc_vram_size) || > (data.inject.address >= RAS_UMC_INJECT_ADDR_LIMIT)) { > dev_warn(adev->dev, "RAS WARN: input address " > "0x%llx is invalid.", > -- > 2.17.1