Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560988

[PATCH 2/2] drm/vc4: Return -EINVAL on the overflow checks failing.

From Eric Anholt <eric@anholt.net>
Newsgroups linux.kernel
Subject [PATCH 2/2] drm/vc4: Return -EINVAL on the overflow checks failing.
Date 2017-01-17 21:30 +0100
Message-ID <t0Iye-3cj-9@gated-at.bofh.it> (permalink)
References <t0Iye-3cj-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


By failing to set the errno, we'd continue on to trying to set up the
RCL, and then oops on trying to dereference the tile_bo that binning
validation should have set up.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
---
 drivers/gpu/drm/vc4/vc4_gem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index c5fe3554858e..ab3016982466 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -601,6 +601,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec)
 					  sizeof(struct vc4_shader_state)) ||
 	    temp_size < exec_size) {
 		DRM_ERROR("overflow in exec arguments\n");
+		ret = -EINVAL;
 		goto fail;
 	}
 
-- 
2.11.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/2] drm/vc4: Return -EINVAL on the overflow checks failing. Eric Anholt <eric@anholt.net> - 2017-01-17 21:30 +0100

csiph-web