From 996785d178d009c5105c6cf9c2288da463cf0914 Mon Sep 17 00:00:00 2001 From: Oded Gabbay Date: Tue, 3 Mar 2015 15:22:49 +0200 Subject: [PATCH] Call __fmm_release with gpu id and not index __fmm_release expects gpu_id as parameter. fmm_release passed it instead the index of the GPU in the gpu_mem array. Signed-off-by: Oded Gabbay [ROCm/ROCR-Runtime commit: aba396bc527568605f894817eafc85fb776f4406] --- projects/rocr-runtime/src/fmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/src/fmm.c b/projects/rocr-runtime/src/fmm.c index bda55cf3a9..6f5e651054 100644 --- a/projects/rocr-runtime/src/fmm.c +++ b/projects/rocr-runtime/src/fmm.c @@ -627,7 +627,7 @@ static void __fmm_release(uint32_t gpu_id, void *address, pthread_mutex_lock(&aperture->fmm_mutex); /* Find the object to retrieve the handle */ - object = vm_find_object_by_address(aperture, address, 0); + object = vm_find_object_by_address(aperture, address, MemorySizeInBytes); if (!object) { pthread_mutex_unlock(&aperture->fmm_mutex); return; @@ -654,7 +654,7 @@ void fmm_release(void *address, uint64_t MemorySizeInBytes) if (address >= gpu_mem[i].gpuvm_aperture.base && address <= gpu_mem[i].gpuvm_aperture.limit) { found = true; - __fmm_release(i, address, MemorySizeInBytes); + __fmm_release(gpu_mem[i].gpu_id, address, MemorySizeInBytes); fmm_print(gpu_mem[i].gpu_id); } }