[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