Commit 3e72be17 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Drop fb reference on load_detect_pipe failure path

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: default avatarChris 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>
Fixes: edde3617 ("drm/i915: Use atomic state to obtain load detection crtc, v3.")
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171207220025.22698-1-chris@chris-wilson.co.uk
parent 7a1530d7
...@@ -9939,11 +9939,10 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, ...@@ -9939,11 +9939,10 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
} }
ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0); ret = intel_modeset_setup_plane_state(state, crtc, mode, fb, 0, 0);
drm_framebuffer_put(fb);
if (ret) if (ret)
goto fail; goto fail;
drm_framebuffer_put(fb);
ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode); ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
if (ret) if (ret)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment