devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@linaro.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, linux-imx@nxp.com,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Peng Fan <peng.fan@nxp.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 1/6] clk: imx93: unmap anatop base in error handling path
Date: Fri, 4 Nov 2022 23:20:21 +0200	[thread overview]
Message-ID: <Y2WCFSGLNN1Rt9UZ@linaro.org> (raw)
In-Reply-To: <20221028095211.2598312-2-peng.fan@oss.nxp.com>

On 22-10-28 17:52:06, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The anatop base is not unmapped during error handling path, fix it.
> 
> Fixes: 24defbe194b6 ("clk: imx: add i.MX93 clk")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

> ---
>  drivers/clk/imx/clk-imx93.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c
> index 99cff1fd108b..9ef3fcbdd951 100644
> --- a/drivers/clk/imx/clk-imx93.c
> +++ b/drivers/clk/imx/clk-imx93.c
> @@ -258,7 +258,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
>  	struct device_node *np = dev->of_node;
>  	const struct imx93_clk_root *root;
>  	const struct imx93_clk_ccgr *ccgr;
> -	void __iomem *base = NULL;
> +	void __iomem *base, *anatop_base;
>  	int i, ret;
>  
>  	clk_hw_data = kzalloc(struct_size(clk_hw_data, hws,
> @@ -285,20 +285,22 @@ static int imx93_clocks_probe(struct platform_device *pdev)
>  								    "sys_pll_pfd2", 1, 2);
>  
>  	np = of_find_compatible_node(NULL, NULL, "fsl,imx93-anatop");
> -	base = of_iomap(np, 0);
> +	anatop_base = of_iomap(np, 0);
>  	of_node_put(np);
> -	if (WARN_ON(!base))
> +	if (WARN_ON(!anatop_base))
>  		return -ENOMEM;
>  
> -	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", base + 0x1200,
> +	clks[IMX93_CLK_AUDIO_PLL] = imx_clk_fracn_gppll("audio_pll", "osc_24m", anatop_base + 0x1200,
>  							&imx_fracn_gppll);
> -	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", base + 0x1400,
> +	clks[IMX93_CLK_VIDEO_PLL] = imx_clk_fracn_gppll("video_pll", "osc_24m", anatop_base + 0x1400,
>  							&imx_fracn_gppll);
>  
>  	np = dev->of_node;
>  	base = devm_platform_ioremap_resource(pdev, 0);
> -	if (WARN_ON(IS_ERR(base)))
> +	if (WARN_ON(IS_ERR(base))) {
> +		iounmap(anatop_base);
>  		return PTR_ERR(base);
> +	}
>  
>  	for (i = 0; i < ARRAY_SIZE(root_array); i++) {
>  		root = &root_array[i];
> @@ -327,6 +329,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
>  
>  unregister_hws:
>  	imx_unregister_hw_clocks(clks, IMX93_CLK_END);
> +	iounmap(anatop_base);
>  
>  	return ret;
>  }
> -- 
> 2.37.1
> 

  reply	other threads:[~2022-11-04 21:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28  9:52 [PATCH 0/6] clk: imx93: fix and update Peng Fan (OSS)
2022-10-28  9:52 ` [PATCH 1/6] clk: imx93: unmap anatop base in error handling path Peng Fan (OSS)
2022-11-04 21:20   ` Abel Vesa [this message]
2022-10-28  9:52 ` [PATCH 2/6] clk: imx93: correct enet clock Peng Fan (OSS)
2022-11-04 20:52   ` Abel Vesa
2022-10-28  9:52 ` [PATCH 3/6] dt-bindings: clock: imx93: drop TPM1/3 LPIT1/2 entry Peng Fan (OSS)
2022-10-28 22:07   ` Krzysztof Kozlowski
2022-11-04 21:08   ` Abel Vesa
2022-10-28  9:52 ` [PATCH 4/6] clk: imx93: drop tpm1/3, lpit1/2 clk Peng Fan (OSS)
2022-11-04 21:22   ` Abel Vesa
2022-10-28  9:52 ` [PATCH 5/6] clk: imx: keep hsio bus clock always on Peng Fan (OSS)
2022-11-04 21:34   ` Abel Vesa
2022-10-28  9:52 ` [PATCH 6/6] clk: imx93: keep sys ctr " Peng Fan (OSS)
2022-11-04 21:31   ` Abel Vesa
2022-11-02  2:13 ` [PATCH 0/6] clk: imx93: fix and update Peng Fan
2022-11-04 20:51   ` Abel Vesa
2022-11-21 15:58 ` Abel Vesa
  -- strict thread matches above, loose matches on Subject: below --
2022-10-27 10:11 Peng Fan (OSS)
2022-10-27 10:11 ` [PATCH 1/6] clk: imx93: unmap anatop base in error handling path Peng Fan (OSS)

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=Y2WCFSGLNN1Rt9UZ@linaro.org \
    --to=abel.vesa@linaro.org \
    --cc=abelvesa@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.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;
as well as URLs for NNTP newsgroup(s).