diff options
author | Eric Anholt <eric@anholt.net> | 2008-09-10 17:22:49 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-10-17 17:10:52 -0400 |
commit | 4f481ed22ec0d412336a13dc4477f6d0f3688882 (patch) | |
tree | 079faba388193dbe9234aedf2cd314df3b90be1b /drivers/gpu | |
parent | d4e7b898c12b2b458323243abdd4a215f8f8f090 (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')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 |
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 5fe50343de11..29d9d21e9413 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, | |||
1763 | (int) args->buffers_ptr, args->buffer_count, args->batch_len); | 1763 | (int) args->buffers_ptr, args->buffer_count, args->batch_len); |
1764 | #endif | 1764 | #endif |
1765 | 1765 | ||
1766 | if (args->buffer_count < 1) { | ||
1767 | DRM_ERROR("execbuf with %d buffers\n", args->buffer_count); | ||
1768 | return -EINVAL; | ||
1769 | } | ||
1766 | /* Copy in the exec list from userland */ | 1770 | /* Copy in the exec list from userland */ |
1767 | exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count, | 1771 | exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count, |
1768 | DRM_MEM_DRIVER); | 1772 | DRM_MEM_DRIVER); |