aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1391-Fix-a-memory-leak-in-error-handling.patch
blob: 73f69299a1b562d5ac07abf5dcaa8e308091d62d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 5f6e5f638e1e420f73a173c6ad6b30eba1ab98fe Mon Sep 17 00:00:00 2001
From: Yong Zhao <yong.zhao@amd.com>
Date: Mon, 18 Apr 2016 16:58:55 -0400
Subject: [PATCH 1391/4131] Fix a memory leak in error handling

Change-Id: I55da0b1e4d9fbac69ec8f8cc25c0551b0764884a
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index b0430c1..8d421f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -127,9 +127,9 @@ static int add_bo_to_vm(struct amdgpu_device *adev, uint64_t va,
 	 * list. amdgpu_vm_clear_freed needs the PTs to be reserved so
 	 * we don't call it here. That can wait until the next time
 	 * the page tables are updated for a map or unmap. */
-	kfree(bo_va_entry);
 err_vmadd:
 	amdgpu_bo_unreserve(bo);
+	kfree(bo_va_entry);
 	return ret;
 }
 
-- 
2.7.4