aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch
new file mode 100644
index 00000000..2b1db3fe
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2730-drm-amdkfd-Fix-handling-of-return-code-of-dma_buf_ge.patch
@@ -0,0 +1,34 @@
+From 729d6743e262096ea1abbf7df687986e14e62053 Mon Sep 17 00:00:00 2001
+From: Felix Kuehling <Felix.Kuehling@amd.com>
+Date: Fri, 14 Dec 2018 11:57:02 -0500
+Subject: [PATCH 2730/2940] drm/amdkfd: Fix handling of return code of
+ dma_buf_get
+
+On errors, dma_buf_get returns a negative error code, rather than NULL.
+
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+index 3623538baf6f..db6f27fe3d5a 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+@@ -1629,8 +1629,8 @@ static int kfd_ioctl_import_dmabuf(struct file *filep,
+ return -EINVAL;
+
+ dmabuf = dma_buf_get(args->dmabuf_fd);
+- if (!dmabuf)
+- return -EINVAL;
++ if (IS_ERR(dmabuf))
++ return PTR_ERR(dmabuf);
+
+ mutex_lock(&p->mutex);
+
+--
+2.17.1
+