public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Markus Schneider-Pargmann <msp@baylibre.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: sboyd@kernel.org, mturquette@baylibre.com,
	matthias.bgg@gmail.com, wenst@chromium.org,
	u.kleine-koenig@pengutronix.de, miles.chen@mediatek.com,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH 3/3] clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue
Date: Fri, 16 Jun 2023 10:51:04 +0200	[thread overview]
Message-ID: <20230616085104.mjlt63e24ebzslsz@blmsp> (raw)
In-Reply-To: <20230615122051.546985-4-angelogioacchino.delregno@collabora.com>

Hi Angelo,

On Thu, Jun 15, 2023 at 02:20:51PM +0200, AngeloGioacchino Del Regno wrote:
> In case of error after of_ioremap() the resource must be released:
> call iounmap() where appropriate to fix that.
> 
> Fixes: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> index ba1386e70a24..1bbb21ab1786 100644
> --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> @@ -151,8 +151,10 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
> -	if (IS_ERR_OR_NULL(clk_data))
> +	if (IS_ERR_OR_NULL(clk_data)) {
> +		iounmap(base);
>  		return -ENOMEM;

More of a nitpick, but I would prefer if you would use the same error
catching style as the rest of the probe function:

		if (IS_ERR_OR_NULL(clk_data)) {
			r = -ENOMEM;
			goto unmap_io;
		}
	...
	unmap_io:
		iounmap(base)
		return r;


Best,
Markus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-06-16  8:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 12:20 [PATCH 0/3] MediaTek clocks: various fixes AngeloGioacchino Del Regno
2023-06-15 12:20 ` [PATCH 1/3] clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks AngeloGioacchino Del Regno
2023-06-16  3:10   ` Chen-Yu Tsai
2023-06-16  8:43   ` Markus Schneider-Pargmann
2023-06-16 19:21   ` Stephen Boyd
2023-06-15 12:20 ` [PATCH 2/3] clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error AngeloGioacchino Del Regno
2023-06-16  3:08   ` Chen-Yu Tsai
2023-06-16  8:43   ` Markus Schneider-Pargmann
2023-06-16 19:21   ` Stephen Boyd
2023-06-15 12:20 ` [PATCH 3/3] clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue AngeloGioacchino Del Regno
2023-06-16  3:08   ` Chen-Yu Tsai
2023-06-16  8:51   ` Markus Schneider-Pargmann [this message]
2023-06-16 19:21   ` Stephen Boyd

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=20230616085104.mjlt63e24ebzslsz@blmsp \
    --to=msp@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wenst@chromium.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