* Patch "drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()" has been added to the 4.9-stable tree
@ 2017-01-15 16:39 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-15 16:39 UTC (permalink / raw)
To: dan.carpenter, eric, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-vc4-fix-a-couple-error-codes-in-vc4_cl_lookup_bos.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From b2cdeb19f16ad984eb5bb9193f793d05a8101511 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 13 Oct 2016 11:54:31 +0300
Subject: drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()
From: Dan Carpenter <dan.carpenter@oracle.com>
commit b2cdeb19f16ad984eb5bb9193f793d05a8101511 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/vc4/vc4_gem.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -544,14 +544,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;
}
Patches currently in stable-queue which might be from dan.carpenter@oracle.com are
queue-4.9/drm-vc4-fix-a-couple-error-codes-in-vc4_cl_lookup_bos.patch
queue-4.9/drm-savage-dereferencing-an-error-pointer.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-15 16:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-15 16:39 Patch "drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()" has been added to the 4.9-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).