drm/i915; Only increment the user-pin-count after successfully pinning the bo
As along the error path we do not correct the user pin-count for the failure, we may end up with userspace believing that it has a pinned object at offset 0 (when interrupted by a signal for example). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
committed by
Daniel Vetter
parent
d1c3ed669a
commit
93be8788e6
@@ -3522,14 +3522,15 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj->user_pin_count++;
|
if (obj->user_pin_count == 0) {
|
||||||
obj->pin_filp = file;
|
|
||||||
if (obj->user_pin_count == 1) {
|
|
||||||
ret = i915_gem_object_pin(obj, args->alignment, true, false);
|
ret = i915_gem_object_pin(obj, args->alignment, true, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obj->user_pin_count++;
|
||||||
|
obj->pin_filp = file;
|
||||||
|
|
||||||
/* XXX - flush the CPU caches for pinned objects
|
/* XXX - flush the CPU caches for pinned objects
|
||||||
* as the X server doesn't manage domains yet
|
* as the X server doesn't manage domains yet
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user