From 87ddd7732e872415d40e1b980793b2c6004e711d Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Mon, 23 Nov 2015 11:49:11 -0500 Subject: [PATCH] Fix dgpu_vm_limit Break from the for-loop once dgpu VM range is found, otherwise the length is reduced by half Change-Id: Ie602054c16ea69ea1cbb75e804ead551bc3615c0 Signed-off-by: Harish Kasiviswanathan [ROCm/ROCR-Runtime commit: 5a55383baf6075e6a5637fbc3493cbb022130bf7] --- projects/rocr-runtime/src/fmm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/src/fmm.c b/projects/rocr-runtime/src/fmm.c index 80d52aa8e0..5d13f57069 100644 --- a/projects/rocr-runtime/src/fmm.c +++ b/projects/rocr-runtime/src/fmm.c @@ -1441,8 +1441,10 @@ static HSAKMT_STATUS dgpu_mem_init(uint32_t gpu_mem_id, void **base, void **limi (HSAint64)ret_addr) >> 30)); munmap(ret_addr, len); continue; - } else + } else { found = true; + break; + } } if (!found) {