diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 81687af00893..de431942ded4 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -498,8 +498,8 @@ pin_and_fence_object(struct drm_i915_gem_object *obj, | |||
| 498 | if (ret) | 498 | if (ret) |
| 499 | goto err_unpin; | 499 | goto err_unpin; |
| 500 | } | 500 | } |
| 501 | obj->pending_fenced_gpu_access = true; | ||
| 501 | } | 502 | } |
| 502 | obj->pending_fenced_gpu_access = need_fence; | ||
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | entry->offset = obj->gtt_offset; | 505 | entry->offset = obj->gtt_offset; |
| @@ -1133,6 +1133,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
| 1133 | return -EINVAL; | 1133 | return -EINVAL; |
| 1134 | } | 1134 | } |
| 1135 | 1135 | ||
| 1136 | if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) { | ||
| 1137 | DRM_DEBUG("execbuf with %u cliprects\n", | ||
| 1138 | args->num_cliprects); | ||
| 1139 | return -EINVAL; | ||
| 1140 | } | ||
| 1136 | cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects), | 1141 | cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects), |
| 1137 | GFP_KERNEL); | 1142 | GFP_KERNEL); |
| 1138 | if (cliprects == NULL) { | 1143 | if (cliprects == NULL) { |
| @@ -1404,7 +1409,8 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data, | |||
| 1404 | struct drm_i915_gem_exec_object2 *exec2_list = NULL; | 1409 | struct drm_i915_gem_exec_object2 *exec2_list = NULL; |
| 1405 | int ret; | 1410 | int ret; |
| 1406 | 1411 | ||
| 1407 | if (args->buffer_count < 1) { | 1412 | if (args->buffer_count < 1 || |
| 1413 | args->buffer_count > UINT_MAX / sizeof(*exec2_list)) { | ||
| 1408 | DRM_DEBUG("execbuf2 with %d buffers\n", args->buffer_count); | 1414 | DRM_DEBUG("execbuf2 with %d buffers\n", args->buffer_count); |
| 1409 | return -EINVAL; | 1415 | return -EINVAL; |
| 1410 | } | 1416 | } |
