]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/vc4: Fix oops when userspace hands in a bad BO.
authorEric Anholt <eric@anholt.net>
Tue, 26 Jul 2016 20:47:15 +0000 (13:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:20:27 +0000 (08:20 +0200)
commit 552416c146fadc67cd9b53ef7adf88d3381c43a6 upstream.

We'd end up NULL pointer dereferencing because we didn't take the
error path out in the parent.  Fixes igt vc4_lookup_fail test.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vc4/vc4_gem.c

index f9b13b54c86b70256264b69608aa9e4f78712d33..78ab08e8f87eb064e3eeec761b26c19f11c1f4e5 100644 (file)
@@ -575,7 +575,7 @@ vc4_cl_lookup_bos(struct drm_device *dev,
 
 fail:
        drm_free_large(handles);
-       return 0;
+       return ret;
 }
 
 static int