aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch
new file mode 100644
index 00000000..7c9949da
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2867-drm-amdkfd-Check-for-NULL-return-on-kzalloc.patch
@@ -0,0 +1,29 @@
+From c950088f56e13dbf3229b7b4c7fc44bdf3d3bc0b Mon Sep 17 00:00:00 2001
+From: Kent Russell <kent.russell@amd.com>
+Date: Tue, 21 Nov 2017 08:47:22 -0500
+Subject: [PATCH 2867/4131] drm/amdkfd: Check for NULL return on kzalloc
+
+We can get a NULL return from kzalloc, so check for it.
+
+Change-Id: Id8c0113ef49a9f75ffe74318852fa6eb5563ecf5
+Signed-off-by: Kent Russell <kent.russell@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
+index 9a219c0..977fcf9 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
+@@ -109,6 +109,8 @@ static int init_mqd(struct mqd_manager *mm, void **mqd,
+ */
+ if (kfd->cwsr_enabled && (q->type == KFD_QUEUE_TYPE_COMPUTE)) {
+ *mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_NOIO);
++ if (!*mqd_mem_obj)
++ return -ENOMEM;
+ retval = kfd->kfd2kgd->init_gtt_mem_allocation(kfd->kgd,
+ ALIGN(q->ctl_stack_size, PAGE_SIZE) +
+ ALIGN(sizeof(struct v9_mqd), PAGE_SIZE),
+--
+2.7.4
+