[PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference

Joshi, Mukul Mukul.Joshi at amd.com
Wed Apr 6 23:08:34 UTC 2022


[AMD Official Use Only]

Reviewed-by: Mukul Joshi <mukul.joshi at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Felix
> Kuehling
> Sent: Wednesday, April 6, 2022 5:06 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhou1, Tao <Tao.Zhou1 at amd.com>
> Subject: [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference
> 
> [CAUTION: External Email]
> 
> Check that adev->gfx.ras is valid before using it.
> 
> Fixes: f385fc0d19ce ("drm/amdgpu: add UTCL2 RAS poison query for
> Aldebaran (v2)")
> CC: Tao Zhou <tao.zhou1 at amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> index c18c4be1e4ac..64c6664b34e8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> @@ -727,7 +727,7 @@ void
> amdgpu_amdkfd_ras_poison_consumption_handler(struct amdgpu_device
> *adev, bo
> 
>  bool amdgpu_amdkfd_ras_query_utcl2_poison_status(struct
> amdgpu_device *adev)  {
> -       if (adev->gfx.ras->query_utcl2_poison_status)
> +       if (adev->gfx.ras && adev->gfx.ras->query_utcl2_poison_status)
>                 return adev->gfx.ras->query_utcl2_poison_status(adev);
>         else
>                 return false;
> --
> 2.32.0


More information about the amd-gfx mailing list