All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: broonie@kernel.org, chleroy@kernel.org, leoyang.li@nxp.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	qiang.zhao@nxp.com, stable@vger.kernel.org
Subject: Re: [PATCH] soc: fsl: cpm1: tsa: Fix clock leak in tsa_of_parse_tdms()
Date: Thu, 17 Sep 2026 19:49:53 +0200	[thread overview]
Message-ID: <20260917194953.69dfd873@bootlin.com> (raw)
In-Reply-To: <20260917152719.2160395-1-vulab@iscas.ac.cn>

Hi Wentao,

On Thu, 17 Sep 2026 15:27:19 +0000
Wentao Liang <vulab@iscas.ac.cn> wrote:

> The error cleanup loop puts l1rsync_clk and l1rclk_clk a second time
> and never puts l1tsync_clk or l1tclk_clk, because the branches that
> guard the transmit clocks use the receive clock field names.
> 
> Use the matching field in each branch so every clock acquired by
> tsa_of_parse_tdms() is released exactly once.
> 
> Fixes: 1d4ba0b81c1c ("soc: fsl: cpm1: Add support for TSA")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/soc/fsl/qe/tsa.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/tsa.c b/drivers/soc/fsl/qe/tsa.c
> index 4a88e54d25b9..94691369353e 100644
> --- a/drivers/soc/fsl/qe/tsa.c
> +++ b/drivers/soc/fsl/qe/tsa.c
> @@ -865,12 +865,12 @@ static int tsa_of_parse_tdms(struct tsa *tsa, struct device_node *np)
>  			clk_put(tsa->tdm[i].l1rclk_clk);
>  		}
>  		if (tsa->tdm[i].l1tsync_clk) {
> -			clk_disable_unprepare(tsa->tdm[i].l1rsync_clk);
> -			clk_put(tsa->tdm[i].l1rsync_clk);
> +			clk_disable_unprepare(tsa->tdm[i].l1tsync_clk);
> +			clk_put(tsa->tdm[i].l1tsync_clk);
>  		}
>  		if (tsa->tdm[i].l1tclk_clk) {
> -			clk_disable_unprepare(tsa->tdm[i].l1rclk_clk);
> -			clk_put(tsa->tdm[i].l1rclk_clk);
> +			clk_disable_unprepare(tsa->tdm[i].l1tclk_clk);
> +			clk_put(tsa->tdm[i].l1tclk_clk);
>  		}
>  	}
>  	return ret;

Indeed, good catch!

Reviewed-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé


  reply	other threads:[~2026-09-17 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 15:27 [PATCH] soc: fsl: cpm1: tsa: Fix clock leak in tsa_of_parse_tdms() Wentao Liang
2026-09-17 17:49 ` Herve Codina [this message]
2026-09-18  8:39 ` Christophe Leroy (CS GROUP)
2026-10-09  9:21   ` Christophe Leroy (CS GROUP)

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=20260917194953.69dfd873@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=qiang.zhao@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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 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.