From: Jonathan Kim Date: Wed, 21 Feb 2024 10:20:34 +0000 (-0500) Subject: drm/amdkfd: fix process reference drop on debug ioctl X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f05159a0db05fe93acf2701dd1b39c690237c8e;p=linux.git drm/amdkfd: fix process reference drop on debug ioctl 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 Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 80e90fdef291d..824e660283b2a 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; }