From: Eric Anholt Date: Tue, 17 Jan 2017 20:20:50 +0000 (+1100) Subject: drm/vc4: Return -EINVAL on the overflow checks failing. X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~11^2^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6b838bef9269dfa52024748a28e27854805b0094;p=linux-4.9.git drm/vc4: Return -EINVAL on the overflow checks failing. 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 Signed-off-by: Eric Anholt Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Gbp-Pq: Topic bugfix/arm/drm Gbp-Pq: Name vc4-return-einval-on-the-overflow-checks-failing.patch --- diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index 39ef6743d3b8..18e37171e9c8 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; }