summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2016-10-29 15:09:36 +0100
committerPeter Robinson <pbrobinson@gmail.com>2016-10-29 15:09:36 +0100
commit11ce6a972dc2e715eb7c05354bf6f85da1ed880e (patch)
tree9487633f6b686d1949366f640806f7b0a9931e98
parent1fb17f8293b0dfdfcd5ca5b3839ddddc077e6b6e (diff)
downloadkernel-11ce6a972dc2e715eb7c05354bf6f85da1ed880e.tar.gz
kernel-11ce6a972dc2e715eb7c05354bf6f85da1ed880e.tar.xz
kernel-11ce6a972dc2e715eb7c05354bf6f85da1ed880e.zip
Minor VC4 bug fix
-rw-r--r--bcm283x-vc4-fixes.patch43
-rw-r--r--kernel.spec3
2 files changed, 46 insertions, 0 deletions
diff --git a/bcm283x-vc4-fixes.patch b/bcm283x-vc4-fixes.patch
index afde6e2f2..4d496ec4d 100644
--- a/bcm283x-vc4-fixes.patch
+++ b/bcm283x-vc4-fixes.patch
@@ -945,3 +945,46 @@ index c6420b3..e8a9646a 100644
--
cgit v0.12
+From 30772942cc1095c3129eecfa182e2c568e566b9d Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 13 Oct 2016 11:54:31 +0300
+Subject: [PATCH] drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()
+
+If the allocation fails the current code returns success. If
+copy_from_user() fails it returns the number of bytes remaining instead
+of -EFAULT.
+
+Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+---
+ drivers/gpu/drm/vc4/vc4_gem.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
+index ae1609e..4050540 100644
+--- a/drivers/gpu/drm/vc4/vc4_gem.c
++++ b/drivers/gpu/drm/vc4/vc4_gem.c
+@@ -548,14 +548,15 @@ vc4_cl_lookup_bos(struct drm_device *dev,
+
+ handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t));
+ if (!handles) {
++ ret = -ENOMEM;
+ DRM_ERROR("Failed to allocate incoming GEM handles\n");
+ goto fail;
+ }
+
+- ret = copy_from_user(handles,
+- (void __user *)(uintptr_t)args->bo_handles,
+- exec->bo_count * sizeof(uint32_t));
+- if (ret) {
++ if (copy_from_user(handles,
++ (void __user *)(uintptr_t)args->bo_handles,
++ exec->bo_count * sizeof(uint32_t))) {
++ ret = -EFAULT;
+ DRM_ERROR("Failed to copy in GEM handles\n");
+ goto fail;
+ }
+--
+2.9.3
+
diff --git a/kernel.spec b/kernel.spec
index 292756742..f47d50984 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -2168,6 +2168,9 @@ fi
#
#
%changelog
+* Sat Oct 29 2016 Peter Robinson <pbrobinson@fedoraproject.org>
+- Minor VC4 bug fix
+
* Fri Oct 28 2016 Justin M. Forbes <jforbes@fedoraproject.org> - 4.8.5-300
- Linux v4.8.5