aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch
new file mode 100644
index 00000000..5ad3286b
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1484-drm-amdkfd-Fix-a-memory-leak-when-idr_alloc-fails.patch
@@ -0,0 +1,28 @@
+From cf1ca0ae8018f8373f3c9ccf3cb5dc1e19ddedfa Mon Sep 17 00:00:00 2001
+From: Yong Zhao <yong.zhao@amd.com>
+Date: Tue, 9 Aug 2016 12:32:20 -0400
+Subject: [PATCH 1484/4131] drm/amdkfd: Fix a memory leak when idr_alloc fails
+
+Change-Id: I76185d558a0549e627badf024818a33f5fd6be7b
+Signed-off-by: Yong Zhao <yong.zhao@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+index d87ff6a..098787a 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+@@ -928,6 +928,9 @@ int kfd_process_device_create_obj_handle(struct kfd_process_device *pdd,
+
+ idr_preload_end();
+
++ if (handle < 0)
++ kfree(buf_obj);
++
+ return handle;
+ }
+
+--
+2.7.4
+