All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Drop fb reference on load_detect_pipe failure path
@ 2017-12-07 22:00 Chris Wilson
  2017-12-07 22:06 ` Chris Wilson
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Chris Wilson @ 2017-12-07 22:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

When intel_modeset_setup_plane_state() fails drop the local framebuffer
reference before jumping to the error, otherwise we leak the framebuffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1f7e312d0d0d..1ba570614dbe 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9940,11 +9940,10 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	}
 
 	ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
+	drm_framebuffer_put(fb);
 	if (ret)
 		goto fail;
 
-	drm_framebuffer_put(fb);
-
 	ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
 	if (ret)
 		goto fail;
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-12-08 11:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-07 22:00 [PATCH] drm/i915: Drop fb reference on load_detect_pipe failure path Chris Wilson
2017-12-07 22:06 ` Chris Wilson
2017-12-07 22:20 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-12-07 22:26   ` Chris Wilson
2017-12-08  0:56 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-12-08 11:14 ` [PATCH] " Ville Syrjälä
2017-12-08 11:31   ` Chris Wilson
2017-12-08 11:49     ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.