Re: [PATCH 1/1] drm/amdkfd: Improve kfd_process lookup in kfd_ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-12-05 11:10 a.m., Philip Yang wrote:
One comment in line.

With it is fixed, this is reviewed by Philip Yang <Philip.Yang@xxxxxxx>

Philip

On 2019-12-04 11:13 p.m., Felix Kuehling wrote:
  diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 8276601a122f..bb2f26532feb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -324,6 +324,8 @@ struct kfd_process *kfd_create_process(struct file *filep)
                      (int)process->lead_thread->pid);
      }
  out:
+    if (process)
if (!IS_ERR_OR_NULL(process))

Thanks for catching that. I think !IS_ERR should be fine. Process should never be NULL here. Also the caller of this function only checks IS_ERR.

Regards,
  Felix



+        kref_get(&process->ref);
      mutex_unlock(&kfd_processes_mutex);
        return process;

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux