amdgpu: Free/uninit vamgr_32 in theoretically correct order

vamgr_32 is a region inside general VAM range. It is better to free and
deinitialize it before general VAM range.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
main
Alex Xie 2017-01-28 21:49:30 +02:00 committed by Alex Deucher
parent 07edf5d905
commit 7a03cdf6a7
1 changed files with 2 additions and 2 deletions

View File

@ -131,10 +131,10 @@ static int amdgpu_get_auth(int fd, int *auth)
static void amdgpu_device_free_internal(amdgpu_device_handle dev)
{
amdgpu_vamgr_deinit(dev->vamgr);
free(dev->vamgr);
amdgpu_vamgr_deinit(dev->vamgr_32);
free(dev->vamgr_32);
amdgpu_vamgr_deinit(dev->vamgr);
free(dev->vamgr);
util_hash_table_destroy(dev->bo_flink_names);
util_hash_table_destroy(dev->bo_handles);
pthread_mutex_destroy(&dev->bo_table_mutex);