we need to unreserve the bo's too during clean up along
with freeing the memory of context.

Fixes: c549912cd8 (drm/amdkfd: add missing return value check for range)
Signed-off-by: Sunil Khatri <[email protected]>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 7f0ab73e2396..76e36201742a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -1740,7 +1740,7 @@ static int svm_range_validate_and_map(struct mm_struct 
*mm,
                        range = amdgpu_hmm_range_alloc(NULL);
                        if (unlikely(!range)) {
                                r = -ENOMEM;
-                               goto free_ctx;
+                               break;
                        }
 
                        r = amdgpu_hmm_range_get_pages(&prange->notifier, addr, 
npages,
-- 
2.34.1

Reply via email to