[Intel-gfx] [PATCH] drm/i915: Drop fb reference on load_detect_pipe failure path

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Dec 8 11:14:17 UTC 2017


On Thu, Dec 07, 2017 at 10:00:25PM +0000, Chris Wilson wrote:
> When intel_modeset_setup_plane_state() fails drop the local framebuffer
> reference before jumping to the error, otherwise we leak the framebuffer.

Or we could just
https://patchwork.freedesktop.org/patch/165486/

This is
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
nonetheless.

> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter at 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

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list