amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference
@ 2022-04-06 21:06 Felix Kuehling
  2022-04-06 23:08 ` Joshi, Mukul
  2022-04-07  1:23 ` Zhang, Hawking
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Kuehling @ 2022-04-06 21:06 UTC (permalink / raw)
  To: amd-gfx; +Cc: Tao Zhou

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@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference
  2022-04-06 21:06 [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference Felix Kuehling
@ 2022-04-06 23:08 ` Joshi, Mukul
  2022-04-07  1:23 ` Zhang, Hawking
  1 sibling, 0 replies; 3+ messages in thread
From: Joshi, Mukul @ 2022-04-06 23:08 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx; +Cc: Zhou1, Tao

[AMD Official Use Only]

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

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Felix
> Kuehling
> Sent: Wednesday, April 6, 2022 5:06 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Zhou1, Tao <Tao.Zhou1@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@amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference
  2022-04-06 21:06 [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference Felix Kuehling
  2022-04-06 23:08 ` Joshi, Mukul
@ 2022-04-07  1:23 ` Zhang, Hawking
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Hawking @ 2022-04-07  1:23 UTC (permalink / raw)
  To: Kuehling, Felix, amd-gfx; +Cc: Zhou1, Tao

[AMD Official Use Only]

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Felix Kuehling
Sent: Thursday, April 7, 2022 05:06
To: amd-gfx@lists.freedesktop.org
Cc: Zhou1, Tao <Tao.Zhou1@amd.com>
Subject: [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference

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@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-07  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 21:06 [PATCH 1/1] drm/amdkfd: Fix NULL pointer dereference Felix Kuehling
2022-04-06 23:08 ` Joshi, Mukul
2022-04-07  1:23 ` Zhang, Hawking

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).