drm/i915; Only increment the user-pin-count after successfully pinning the bo
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 2 Jan 2013 10:31:22 +0000 (10:31 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Feb 2013 04:33:24 +0000 (04:33 +0000)
commit87ae8984bd9ccca7782bc29776800dc6b8b3bb99
tree8598658389f28fe9cab5d7848819b4fe93de5df6
parent0310953f2c6b90c06b5591cb36d48fb77606459d
drm/i915; Only increment the user-pin-count after successfully pinning the bo

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@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/i915/i915_gem.c