[PATCH 04/11] drm/amdgpu: fix vm init error path

Edward O'Callaghan funfunctor at folklore1984.net
Sat Jul 30 03:44:04 UTC 2016



On 07/30/2016 01:41 PM, Edward O'Callaghan wrote:
> Hi,
> 
> On 07/28/2016 08:13 PM, Chunming Zhou wrote:
>> Change-Id: Ie3d5440dc0d2d3a61d8e785ab08b8b91eda223db
>> Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 11c1263..1d58577 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1682,7 +1682,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm)
>>  	r = amd_sched_entity_init(&ring->sched, &vm->entity,
>>  				  rq, amdgpu_sched_jobs);
>>  	if (r)
> 
> Hmm while we are here I think we should be explicit that non-zero,
> negative return values indicate an error path, so:
> 
> -  	if (r)
> +  	if (r < 0)
> 
> This then follows precisely the semantics documented for
> 'amdgpu_vm_init()' invocations.
wops! 'amd_sched_entity_init()' I mean to say!

> 
> Kind Regards,
> Edward.
> 
>> -		return r;
>> +		goto err;
>>  
>>  	vm->page_directory_fence = NULL;
>>  
>> @@ -1725,6 +1725,9 @@ error_free_page_directory:
>>  error_free_sched_entity:
>>  	amd_sched_entity_fini(&ring->sched, &vm->entity);
>>  
>> +err:
>> +	drm_free_large(vm->page_tables);
>> +
>>  	return r;
>>  }
>>  
>>
> 
> 
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160730/3e45756e/attachment.sig>


More information about the amd-gfx mailing list