提交 4f481ed2 编写于 作者: E Eric Anholt 提交者: Dave Airlie

drm: Avoid oops in GEM execbuffers with bad arguments.

Signed-off-by: NEric Anholt <eric@anholt.net>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 d4e7b898
...@@ -1763,6 +1763,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, ...@@ -1763,6 +1763,10 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
(int) args->buffers_ptr, args->buffer_count, args->batch_len); (int) args->buffers_ptr, args->buffer_count, args->batch_len);
#endif #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 */ /* Copy in the exec list from userland */
exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count, exec_list = drm_calloc(sizeof(*exec_list), args->buffer_count,
DRM_MEM_DRIVER); DRM_MEM_DRIVER);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册