]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdkfd: fix process reference drop on debug ioctl
authorJonathan Kim <Jonathan.Kim@amd.com>
Wed, 21 Feb 2024 10:20:34 +0000 (05:20 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Feb 2024 15:27:50 +0000 (10:27 -0500)
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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

index 80e90fdef291d5b8cdcf7d08c6e319150fcf631b..824e660283b2add23effa0fb102fe235fc0bd747 100644 (file)
@@ -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;
        }