* [PATCH next] drm/amdkfd: Fix kfd_smi_event_process()
@ 2025-04-15 10:44 Dan Carpenter
2025-04-15 13:35 ` Eric Huang
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-04-15 10:44 UTC (permalink / raw)
To: Eric Huang
Cc: Felix Kuehling, Alex Deucher, Christian König, David Airlie,
Simona Vetter, Kent Russell, amd-gfx, dri-devel, linux-kernel,
kernel-janitors
The "pdd->drm_priv" NULL check is reversed so it will lead to a NULL
dereference on the next line.
Fixes: 4172b556fd5b ("drm/amdkfd: add smi events for process start and end")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
index 727a4ce29fe6..c27fd7aec1c3 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
@@ -350,7 +350,7 @@ void kfd_smi_event_process(struct kfd_process_device *pdd, bool start)
struct amdgpu_task_info *task_info;
struct amdgpu_vm *avm;
- if (pdd->drm_priv)
+ if (!pdd->drm_priv)
return;
avm = drm_priv_to_vm(pdd->drm_priv);
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next] drm/amdkfd: Fix kfd_smi_event_process()
2025-04-15 10:44 [PATCH next] drm/amdkfd: Fix kfd_smi_event_process() Dan Carpenter
@ 2025-04-15 13:35 ` Eric Huang
0 siblings, 0 replies; 2+ messages in thread
From: Eric Huang @ 2025-04-15 13:35 UTC (permalink / raw)
To: Dan Carpenter
Cc: Felix Kuehling, Alex Deucher, Christian König, David Airlie,
Simona Vetter, Kent Russell, amd-gfx, dri-devel, linux-kernel,
kernel-janitors
Thanks for the fix, I had the same patch submitted yesterday.
Regards,
Eric
On 2025-04-15 06:44, Dan Carpenter wrote:
> The "pdd->drm_priv" NULL check is reversed so it will lead to a NULL
> dereference on the next line.
>
> Fixes: 4172b556fd5b ("drm/amdkfd: add smi events for process start and end")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> index 727a4ce29fe6..c27fd7aec1c3 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
> @@ -350,7 +350,7 @@ void kfd_smi_event_process(struct kfd_process_device *pdd, bool start)
> struct amdgpu_task_info *task_info;
> struct amdgpu_vm *avm;
>
> - if (pdd->drm_priv)
> + if (!pdd->drm_priv)
> return;
>
> avm = drm_priv_to_vm(pdd->drm_priv);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-15 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 10:44 [PATCH next] drm/amdkfd: Fix kfd_smi_event_process() Dan Carpenter
2025-04-15 13:35 ` Eric Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox