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>
main
monk.liu 2015-05-13 14:01:53 +08:00 committed by Alex Deucher
parent 9066acf109
commit d3e7195066
1 changed files with 3 additions and 0 deletions

View File

@ -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);