|
@@ -620,8 +620,10 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
|
|
|
ret = copy_from_user(cliprects, batch->cliprects,
|
|
|
batch->num_cliprects *
|
|
|
sizeof(struct drm_clip_rect));
|
|
|
- if (ret != 0)
|
|
|
+ if (ret != 0) {
|
|
|
+ ret = -EFAULT;
|
|
|
goto fail_free;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
mutex_lock(&dev->struct_mutex);
|
|
@@ -662,8 +664,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
|
|
|
return -ENOMEM;
|
|
|
|
|
|
ret = copy_from_user(batch_data, cmdbuf->buf, cmdbuf->sz);
|
|
|
- if (ret != 0)
|
|
|
+ if (ret != 0) {
|
|
|
+ ret = -EFAULT;
|
|
|
goto fail_batch_free;
|
|
|
+ }
|
|
|
|
|
|
if (cmdbuf->num_cliprects) {
|
|
|
cliprects = kcalloc(cmdbuf->num_cliprects,
|
|
@@ -676,8 +680,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data,
|
|
|
ret = copy_from_user(cliprects, cmdbuf->cliprects,
|
|
|
cmdbuf->num_cliprects *
|
|
|
sizeof(struct drm_clip_rect));
|
|
|
- if (ret != 0)
|
|
|
+ if (ret != 0) {
|
|
|
+ ret = -EFAULT;
|
|
|
goto fail_clip_free;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
mutex_lock(&dev->struct_mutex);
|