Skip to content

Commit

Permalink
drm: Avoid oops in GEM execbuffers with bad arguments.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Eric Anholt authored and Dave Airlie committed Oct 17, 2008
1 parent d4e7b89 commit 4f481ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
(int) args->buffers_ptr, args->buffer_count, args->batch_len);
#endif

if (args->buffer_count < 1) {
DRM_ERROR("execbuf with %d buffers\n", args->buffer_count);
return -EINVAL;
}
/* Copy in the exec list from userland */
exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count,
DRM_MEM_DRIVER);
Expand Down

0 comments on commit 4f481ed

Please sign in to comment.