This is a note to let you know that I've just added the patch titled drm/i915; Only increment the user-pin-count after successfully pinning the bo to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-i915-only-increment-the-user-pin-count-after-successfully-pinning-the-bo.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 87ae8984bd9ccca7782bc29776800dc6b8b3bb99 Mon Sep 17 00:00:00 2001 From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Date: Wed, 2 Jan 2013 10:31:22 +0000 Subject: drm/i915; Only increment the user-pin-count after successfully pinning the bo From: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> commit 93be8788e648817d62fda33e2998eb6ca6ebf3a3 upstream. 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@xxxxxxxxxxxxxxxxxx> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx> Cc: Weng Meiling <wengmeiling.weng@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3411,14 +3411,15 @@ i915_gem_pin_ioctl(struct drm_device *de goto out; } - obj->user_pin_count++; - obj->pin_filp = file; - if (obj->user_pin_count == 1) { + if (obj->user_pin_count == 0) { ret = i915_gem_object_pin(obj, args->alignment, true); if (ret) goto out; } + obj->user_pin_count++; + obj->pin_filp = file; + /* XXX - flush the CPU caches for pinned objects * as the X server doesn't manage domains yet */ Patches currently in stable-queue which might be from chris@xxxxxxxxxxxxxxxxxx are queue-3.4/drm-i915-only-increment-the-user-pin-count-after-successfully-pinning-the-bo.patch queue-3.4/drm-i915-add-missing-n-to-uts_release-in-the-error_state.patch queue-3.4/drm-i915-sdvo-clean-up-connectors-on-intel_sdvo_init-failures.patch queue-3.4/drm-i915-panel-invert-brightness-via-parameter.patch queue-3.4/drm-i915-dump-uts_release-into-the-error_state.patch queue-3.4/drm-i915-close-race-between-processing-unpin-task-and-queueing-the-flip.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html