aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Xie2017-01-28 13:49:30 -0600
committerAlex Deucher2017-02-02 14:22:07 -0600
commit7a03cdf6a703911d2a8e8ab0781f1e6b88412329 (patch)
treee70375dee26f7fc5a22ba9841971ff5359de9121 /amdgpu/amdgpu_device.c
parent07edf5d905fffb908f48996a4fcc6eac63b9c3ae (diff)
downloadexternal-libdrm-7a03cdf6a703911d2a8e8ab0781f1e6b88412329.tar.gz
external-libdrm-7a03cdf6a703911d2a8e8ab0781f1e6b88412329.tar.xz
external-libdrm-7a03cdf6a703911d2a8e8ab0781f1e6b88412329.zip
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>
Diffstat (limited to 'amdgpu/amdgpu_device.c')
-rw-r--r--amdgpu/amdgpu_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index f4ede031..cad7133d 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -131,10 +131,10 @@ static int amdgpu_get_auth(int fd, int *auth)
131 131
132static void amdgpu_device_free_internal(amdgpu_device_handle dev) 132static void amdgpu_device_free_internal(amdgpu_device_handle dev)
133{ 133{
134 amdgpu_vamgr_deinit(dev->vamgr);
135 free(dev->vamgr);
136 amdgpu_vamgr_deinit(dev->vamgr_32); 134 amdgpu_vamgr_deinit(dev->vamgr_32);
137 free(dev->vamgr_32); 135 free(dev->vamgr_32);
136 amdgpu_vamgr_deinit(dev->vamgr);
137 free(dev->vamgr);
138 util_hash_table_destroy(dev->bo_flink_names); 138 util_hash_table_destroy(dev->bo_flink_names);
139 util_hash_table_destroy(dev->bo_handles); 139 util_hash_table_destroy(dev->bo_handles);
140 pthread_mutex_destroy(&dev->bo_table_mutex); 140 pthread_mutex_destroy(&dev->bo_table_mutex);