summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-09-10 14:22:49 -0700
committerDave Airlie <airlied@linux.ie>2008-10-18 07:10:52 +1000
commit4f481ed22ec0d412336a13dc4477f6d0f3688882 (patch)
tree079faba388193dbe9234aedf2cd314df3b90be1b /drivers/gpu/drm/i915/i915_gem.c
parentd4e7b898c12b2b458323243abdd4a215f8f8f090 (diff)
drm: Avoid oops in GEM execbuffers with bad arguments.
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5fe50343de1..29d9d21e941 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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);