aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7749e78a7300..aa959c4a1836 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -471,12 +471,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
471 return -ENOENT; 471 return -ENOENT;
472 obj_priv = to_intel_bo(obj); 472 obj_priv = to_intel_bo(obj);
473 473
474 /* Bounds check source. 474 /* Bounds check source. */
475 * 475 if (args->offset > obj->size || args->size > obj->size - args->offset) {
476 * XXX: This could use review for overflow issues...
477 */
478 if (args->offset > obj->size || args->size > obj->size ||
479 args->offset + args->size > obj->size) {
480 ret = -EINVAL; 476 ret = -EINVAL;
481 goto err; 477 goto err;
482 } 478 }
@@ -939,12 +935,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
939 return -ENOENT; 935 return -ENOENT;
940 obj_priv = to_intel_bo(obj); 936 obj_priv = to_intel_bo(obj);
941 937
942 /* Bounds check destination. 938 /* Bounds check destination. */
943 * 939 if (args->offset > obj->size || args->size > obj->size - args->offset) {
944 * XXX: This could use review for overflow issues...
945 */
946 if (args->offset > obj->size || args->size > obj->size ||
947 args->offset + args->size > obj->size) {
948 ret = -EINVAL; 940 ret = -EINVAL;
949 goto err; 941 goto err;
950 } 942 }