Skip to content

Commit

Permalink
drm/vc4: Return -EINVAL on the overflow checks failing.
Browse files Browse the repository at this point in the history
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: d5b1a78 ("drm/vc4: Add support for drawing 3D frames.")
(cherry picked from commit 6b8ac63)
  • Loading branch information
anholt committed Jan 25, 2017
1 parent 85c25ba commit c3e2cca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_gem.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit c3e2cca

Please sign in to comment.