AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: fix process reference drop on debug ioctl
@ 2024-02-21 10:54 Jonathan Kim
  2024-02-21 19:21 ` Felix Kuehling
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Kim @ 2024-02-21 10:54 UTC (permalink / raw)
  To: amd-gfx
  Cc: JinHuiEric.Huang, Harish.Kasiviswanathan, Felix.Kuehling,
	Jonathan Kim, Jonathan Kim

Prevent dropping the KFD process reference at the end of a debug
IOCTL call where the acquired process value is an error.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 80e90fdef291..824e660283b2 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -2935,6 +2935,7 @@ static int kfd_ioctl_set_debug_trap(struct file *filep, struct kfd_process *p, v
 	if (IS_ERR_OR_NULL(target)) {
 		pr_debug("Cannot find process PID %i to debug\n", args->pid);
 		r = target ? PTR_ERR(target) : -ESRCH;
+		target = NULL;
 		goto out;
 	}
 
-- 
2.34.1


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

* Re: [PATCH] drm/amdkfd: fix process reference drop on debug ioctl
  2024-02-21 10:54 [PATCH] drm/amdkfd: fix process reference drop on debug ioctl Jonathan Kim
@ 2024-02-21 19:21 ` Felix Kuehling
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Kuehling @ 2024-02-21 19:21 UTC (permalink / raw)
  To: Jonathan Kim, amd-gfx; +Cc: JinHuiEric.Huang, Harish.Kasiviswanathan


On 2024-02-21 05:54, Jonathan Kim wrote:
> Prevent dropping the KFD process reference at the end of a debug
> IOCTL call where the acquired process value is an error.
>
> Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 80e90fdef291..824e660283b2 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -2935,6 +2935,7 @@ static int kfd_ioctl_set_debug_trap(struct file *filep, struct kfd_process *p, v
>   	if (IS_ERR_OR_NULL(target)) {
>   		pr_debug("Cannot find process PID %i to debug\n", args->pid);
>   		r = target ? PTR_ERR(target) : -ESRCH;
> +		target = NULL;
>   		goto out;
>   	}
>   

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

end of thread, other threads:[~2024-02-21 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-21 10:54 [PATCH] drm/amdkfd: fix process reference drop on debug ioctl Jonathan Kim
2024-02-21 19:21 ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox