[PATCH 1/1] drm/amdkfd: Improve kfd_process lookup in kfd_ioctl
Felix Kuehling
felix.kuehling at amd.com
Thu Dec 5 16:58:39 UTC 2019
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 at amd.com>
>
> 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;
>>
More information about the amd-gfx
mailing list