linux_dsm_epyc7002/drivers/gpu/drm/i915/gem/selftests
Xiyu Yang e07c7606a0 drm/i915/selftests: Fix i915_address_space refcnt leak
igt_ppgtt_pin_update() invokes i915_gem_context_get_vm_rcu(), which
returns a reference of the i915_address_space object to "vm" with
increased refcount.

When igt_ppgtt_pin_update() returns, "vm" becomes invalid, so the
refcount should be decreased to keep refcount balanced.

The reference counting issue happens in two exception handling paths of
igt_ppgtt_pin_update(). When i915_gem_object_create_internal() returns
IS_ERR, the refcnt increased by i915_gem_context_get_vm_rcu() is not
decreased, causing a refcnt leak.

Fix this issue by jumping to "out_vm" label when
i915_gem_object_create_internal() returns IS_ERR.

Fixes: a4e7ccdac3 ("drm/i915: Move context management under GEM")
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/1587361342-83494-1-git-send-email-xiyuyang19@fudan.edu.cn
2020-04-20 20:17:50 +01:00
..
huge_gem_object.c drm/i915/selftests: mark huge_gem_object as not shrinkable 2020-03-23 13:49:31 +00:00
huge_gem_object.h drm/i915/selftests: Make headers self-contained 2020-01-03 13:33:36 +00:00
huge_pages.c drm/i915/selftests: Fix i915_address_space refcnt leak 2020-04-20 20:17:50 +01:00
i915_gem_client_blt.c drm/i915: Serialise with engine-pm around requests on the kernel_context 2019-11-25 13:17:18 +00:00
i915_gem_coherency.c drm/i915/selftests: Err out on coherency if initialisation failed 2019-12-27 17:01:32 +00:00
i915_gem_context.c drm/i915: Drop final few uses of drm_i915_private.engine 2020-03-26 10:50:17 +00:00
i915_gem_dmabuf.c drm/i915: Remove dma_buf_kmap selftest 2019-11-25 22:36:01 +01:00
i915_gem_mman.c drm/i915/gem: Drop cached obj->bind_count 2020-04-02 01:17:39 +01:00
i915_gem_object_blt.c drm/i915/selftests: Avoid choosing zero for phys_sz 2020-02-12 10:14:06 +00:00
i915_gem_object.c drm/i915: remove redundant assignment to variable err 2020-04-09 20:19:31 +01:00
i915_gem_phys.c drm/i915/selftests: Drop vestigal struct_mutex guards 2019-10-04 15:39:41 +01:00
igt_gem_utils.c drm/i915: Apply i915_request_skip() on submission 2020-03-04 14:29:50 +00:00
igt_gem_utils.h drm/i915/selftests: Teach igt_gpu_fill_dw() to take intel_context 2019-08-24 09:10:08 +01:00
mock_context.c drm/i915/gem: Consolidate ctx->engines[] release 2020-03-03 17:30:20 +00:00
mock_context.h drm/i915/selftests: make mock_context.h self-contained 2019-12-23 12:38:34 +02:00
mock_dmabuf.c drm/i915: Drop dma_buf->k(un)map 2019-11-25 22:36:14 +01:00
mock_dmabuf.h drm/i915: change to_mock() to an inline function 2019-11-08 09:12:34 +00:00
mock_gem_object.h drm/i915/selftests: Make headers self-contained 2020-01-03 13:33:36 +00:00