Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f481ed2 authored by Eric Anholt's avatar Eric Anholt Committed by Dave Airlie
Browse files

drm: Avoid oops in GEM execbuffers with bad arguments.



Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d4e7b898
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);