summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonk.liu <monk.liu@amd.com>2015-05-13 14:01:53 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:10 -0400
commite3dea535a3fc3864f9335734ac2d2940ba358321 (patch)
tree88d1104c46bc4f5d218b07436bef14a6e24e87a2
parent27078f02dfb2d608f8ee8598c4deeeaa1cf9c7e9 (diff)
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>
-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,
{
struct amdgpu_bo_va_hole *hole;
+ if (va == AMDGPU_INVALID_VA_ADDRESS)
+ return;
+
size = ALIGN(size, mgr->va_alignment);
pthread_mutex_lock(&mgr->bo_va_mutex);