Skip to content

Commit

Permalink
drm/i915: Treat using a purged buffer as a source of EFAULT
Browse files Browse the repository at this point in the history
Since a purged buffer is one without any associated pages, attempting to
use it should generate EFAULT rather than EINVAL, as it is not strictly
an invalid parameter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Feb 4, 2014
1 parent 45d6781 commit 8c99e57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ i915_gem_mmap_gtt(struct drm_file *file,

if (obj->madv != I915_MADV_WILLNEED) {
DRM_ERROR("Attempting to mmap a purgeable buffer\n");
ret = -EINVAL;
ret = -EFAULT;
goto out;
}

Expand Down Expand Up @@ -1973,7 +1973,7 @@ i915_gem_object_get_pages(struct drm_i915_gem_object *obj)

if (obj->madv != I915_MADV_WILLNEED) {
DRM_ERROR("Attempting to obtain a purgeable object\n");
return -EINVAL;
return -EFAULT;
}

BUG_ON(obj->pages_pin_count);
Expand Down Expand Up @@ -3917,7 +3917,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,

if (obj->madv != I915_MADV_WILLNEED) {
DRM_ERROR("Attempting to pin a purgeable buffer\n");
ret = -EINVAL;
ret = -EFAULT;
goto out;
}

Expand Down

0 comments on commit 8c99e57

Please sign in to comment.