aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch
new file mode 100644
index 00000000..beb1dd50
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/5026-drm-amdgpu-return-error-if-both-BOs-and-bo_list-hand.patch
@@ -0,0 +1,48 @@
+From 819563fe631ebcd566e041dd761d3d4e60709e6e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Mon, 30 Jul 2018 16:18:54 +0200
+Subject: [PATCH 5026/5725] drm/amdgpu: return error if both BOs and bo_list
+ handle is given
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Return -EINVAL when both the BOs as well as a list handle is provided in
+the IOCTL.
+
+Signed-off-by: Christian König <christian.koenig@amd.com>
+Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+index 5a466ce..fae6b58 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+@@ -572,14 +572,17 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
+ INIT_LIST_HEAD(&p->validated);
+
+ /* p->bo_list could already be assigned if AMDGPU_CHUNK_ID_BO_HANDLES is present */
+- if (p->bo_list) {
+- mutex_lock(&p->bo_list->lock);
++ if (cs->in.bo_list_handle) {
++ if (p->bo_list)
++ return -EINVAL;
+
+- } else if (cs->in.bo_list_handle) {
+ r = amdgpu_bo_list_get(fpriv, cs->in.bo_list_handle,
+ &p->bo_list);
+ if (r)
+ return r;
++
++ } else if (p->bo_list) {
++ mutex_lock(&p->bo_list->lock);
+ }
+
+ if (p->bo_list) {
+--
+2.7.4
+