drm/i915: Also drop vm.ref along error paths for vma construction
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Jul 2020 21:10:15 +0000 (22:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:13:32 +0000 (08:13 +0200)
commit5e53344673fcf1df8ff52675ab0539fff26a8e29
tree16df269df2f502e4475e32ef552b01c7a151d79a
parent98762e5b00567622d57295d2d3389aea2c37be03
drm/i915: Also drop vm.ref along error paths for vma construction

commit cf1976b11372cac3b57fbae1831f66a4486355d3 upstream.

Not only do we need to release the vm.ref we acquired for the vma on the
duplicate insert branch, but also for the normal error paths, so roll
them all into one.

Reported-by: Andi Shyti <andi.shyti@intel.com>
Suggested-by: Andi Shyti <andi.shyti@intel.com>
Fixes: 2850748ef876 ("drm/i915: Pull i915_vma_pin under the vm->mutex")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: <stable@vger.kernel.org> # v5.5+
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200702211015.29604-1-chris@chris-wilson.co.uk
(cherry picked from commit 03fca66b7a36b52da8915341eee388267f6d5b73)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/i915_vma.c