RE: [PATCH] drm/amdgpu: add missing error handling in function amdgpu_gmc_flush_gpu_tlb_pasid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - AMD Internal Distribution Only]

Hi Alex,

Thanks for your review, I will push other patch to fix those issues.

Regards,
Bob

-----Original Message-----
From: Alex Deucher <alexdeucher@xxxxxxxxx>
Sent: 2024年6月20日 22:59
To: Zhou, Bob <Bob.Zhou@xxxxxxx>
Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Huang, Tim <Tim.Huang@xxxxxxx>; Zhang, Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian <Christian.Koenig@xxxxxxx>
Subject: Re: [PATCH] drm/amdgpu: add missing error handling in function amdgpu_gmc_flush_gpu_tlb_pasid

On Thu, Jun 20, 2024 at 3:47 AM Bob Zhou <bob.zhou@xxxxxxx> wrote:
>
> Fix the unchecked return value warning by warning reported by
> Coverity, so add error handling.
>
> Signed-off-by: Bob Zhou <bob.zhou@xxxxxxx>

Looks like there are a few other places in the driver where
amdgpu_ring_alloc() is not checked.  Can you fix those up too?

Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 322b8ff67cde..3a7622611916 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -718,7 +718,11 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
>                         ndw += kiq->pmf->invalidate_tlbs_size;
>
>                 spin_lock(&adev->gfx.kiq[inst].ring_lock);
> -               amdgpu_ring_alloc(ring, ndw);
> +               r = amdgpu_ring_alloc(ring, ndw);
> +               if (r) {
> +                       spin_unlock(&adev->gfx.kiq[inst].ring_lock);
> +                       goto error_unlock_reset;
> +               }
>                 if (adev->gmc.flush_tlb_needs_extra_type_2)
>                         kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 2,
> all_hub);
>
> --
> 2.34.1
>




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux