Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 4/4] drm/i915/dp_mst: Fix error handling while adding a connector
Date: Fri, 15 Nov 2024 15:17:15 -0500	[thread overview]
Message-ID: <ZzesS36ciEmCgVYv@intel.com> (raw)
In-Reply-To: <20241115164159.1081675-4-imre.deak@intel.com>

On Fri, Nov 15, 2024 at 06:41:59PM +0200, Imre Deak wrote:
> After an error during adding an MST connector the MST port and the
> intel_connector object could be leaked, fix this up.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_dp_mst.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index d91a1d1fb26f4..70daa9131c92d 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -1731,11 +1731,8 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  
>  	ret = drm_connector_init_core(display->drm, connector, &intel_dp_mst_connector_funcs,
>  				      DRM_MODE_CONNECTOR_DisplayPort);
> -	if (ret) {
> -		drm_dp_mst_put_port_malloc(port);
> -		intel_connector_free(intel_connector);
> -		return NULL;
> -	}
> +	if (ret)
> +		goto err_put_port;
>  
>  	intel_connector->dp.dsc_decompression_aux = drm_dp_mst_dsc_aux_for_port(port);
>  	intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);
> @@ -1750,12 +1747,12 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  
>  		ret = drm_connector_attach_encoder(&intel_connector->base, enc);
>  		if (ret)
> -			goto err;
> +			goto err_cleanup_connector;
>  	}
>  
>  	ret = intel_dp_mst_add_properties(intel_dp, connector, pathprop);
>  	if (ret)
> -		goto err;
> +		goto err_cleanup_connector;
>  
>  	ret = intel_dp_hdcp_init(dig_port, intel_connector);
>  	if (ret)
> @@ -1766,8 +1763,12 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
>  
>  	return connector;
>  
> -err:
> +err_cleanup_connector:
>  	drm_connector_cleanup(connector);
> +err_put_port:
> +	drm_dp_mst_put_port_malloc(port);
> +	intel_connector_free(intel_connector);
> +
>  	return NULL;
>  }
>  
> -- 
> 2.44.2
> 

  reply	other threads:[~2024-11-15 20:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 16:41 [PATCH 1/4] drm/i915/dp_mst: Fix connector initialization in intel_dp_add_mst_connector() Imre Deak
2024-11-15 16:41 ` [PATCH 2/4] drm/dp: Add a way to init/add a connector in separate steps Imre Deak
2024-11-15 20:18   ` Rodrigo Vivi
2024-11-18 12:09   ` Jani Nikula
2024-11-18 17:54     ` Imre Deak
2024-11-15 16:41 ` [PATCH 3/4] drm/i915/dp_mst: Expose a connector to kernel users after it's properly initialized Imre Deak
2024-11-15 20:18   ` Rodrigo Vivi
2024-11-18 12:12   ` Jani Nikula
2024-11-18 12:14     ` Imre Deak
2024-11-18 12:23       ` Jani Nikula
2024-11-18 13:12         ` Imre Deak
2024-11-15 16:41 ` [PATCH 4/4] drm/i915/dp_mst: Fix error handling while adding a connector Imre Deak
2024-11-15 20:17   ` Rodrigo Vivi [this message]
2024-11-15 17:08 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915/dp_mst: Fix connector initialization in intel_dp_add_mst_connector() Patchwork
2024-11-15 17:08 ` ✓ Fi.CI.BAT: success " Patchwork
2024-11-15 20:20 ` [PATCH 1/4] " Rodrigo Vivi
2024-11-15 20:30   ` Imre Deak
2024-11-15 22:30     ` Rodrigo Vivi
2024-11-18  9:10     ` Jani Nikula
2024-11-18 10:48       ` Imre Deak
2024-11-15 21:56 ` ✗ Fi.CI.IGT: failure for series starting with [1/4] " Patchwork
2024-11-18 11:45 ` [PATCH 1/4] " Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZzesS36ciEmCgVYv@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox