Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0794aed3 authored by Thomas Daniel's avatar Thomas Daniel Committed by Daniel Vetter
Browse files

drm/i915: Fix context object leak for legacy contexts

Dynamic context pinning for LRCs introduced a leak in legacy mode.
Reinstate context unreference in i915_gem_free_request for legacy contexts.

Leak reported by i-g-t/drv_module_reload fixed by this patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86507


Signed-off-by: default avatarThomas Daniel <thomas.daniel@intel.com>
Reviewed-by: default avatarJohn <Harrison&lt;John.C.Harrison@Intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 8ee558d8
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2574,11 +2574,13 @@ static void i915_gem_free_request(struct drm_i915_gem_request *request)
	list_del(&request->list);
	i915_gem_request_remove_from_client(request);

	if (i915.enable_execlists && ctx) {
	if (ctx) {
		if (i915.enable_execlists) {
			struct intel_engine_cs *ring = request->ring;

			if (ctx != ring->default_context)
				intel_lr_context_unpin(ring, ctx);
		}
		i915_gem_context_unreference(ctx);
	}
	kfree(request);