aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormonk.liu2015-05-13 01:01:53 -0500
committerAlex Deucher2015-08-05 12:47:49 -0500
commitd3e7195066c37e242b16ec67c732eeee1f693ab0 (patch)
treec0fd56a947b79508f1b4c5ab4994d30501b39b4d /amdgpu/amdgpu_vamgr.c
parent9066acf10900fb6afaa49383116324d94e5aaacd (diff)
downloadexternal-libgbm-d3e7195066c37e242b16ec67c732eeee1f693ab0.tar.gz
external-libgbm-d3e7195066c37e242b16ec67c732eeee1f693ab0.tar.xz
external-libgbm-d3e7195066c37e242b16ec67c732eeee1f693ab0.zip
amdgpu: fix vamgr_free_va logic
va+size will overflow if va equals to AMDGPU_INVALID_VA_ADDRESS, just return when hit that condition Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Jammy Zhou <jammy.zhou@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_vamgr.c')
-rw-r--r--amdgpu/amdgpu_vamgr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 877e0baa..34c28878 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -113,6 +113,9 @@ void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va,
113{ 113{
114 struct amdgpu_bo_va_hole *hole; 114 struct amdgpu_bo_va_hole *hole;
115 115
116 if (va == AMDGPU_INVALID_VA_ADDRESS)
117 return;
118
116 size = ALIGN(size, mgr->va_alignment); 119 size = ALIGN(size, mgr->va_alignment);
117 120
118 pthread_mutex_lock(&mgr->bo_va_mutex); 121 pthread_mutex_lock(&mgr->bo_va_mutex);