mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	linux-clk@vger.kernel.org, Brian Masney <bmasney@redhat.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: stable@vger.kernel.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/7] clk: st: clkgen-pll: Add iounmap() in clkgen_c32_pll_setup()
Date: Wed, 21 Jan 2026 11:03:18 +0100	[thread overview]
Message-ID: <398b4dab-ee76-44f4-9bfd-4388af954808@web.de> (raw)
In-Reply-To: <20260121012223.186199-5-lihaoxiang@isrc.iscas.ac.cn>

> Add a iounmap() to release the memory allocated by

      an          call?


> clkgen_get_register_base() in error path.

Was such an improvable implementation detail detected by any known source code
analysis approaches?


…
> +++ b/drivers/clk/st/clkgen-pll.c
> @@ -829,6 +829,9 @@ static void __init clkgen_c32_pll_setup(struct device_node *np,
>  	kfree(pll_name);
>  	kfree(clk_data->clks);
>  	kfree(clk_data);
> +err_unmap:
> +	if (pll_base)
> +		iounmap(pll_base);

* I find this pointer check redundant because of a previous variable check.
  https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/clk/st/clkgen-pll.c#L771-L773

* I suggest to refine the goto chain a bit more.


>  }
>  
>  static void __init clkgen_c32_pll0_setup(struct device_node *np)

Regards,
Markus

  reply	other threads:[~2026-01-21 10:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  1:22 [PATCH v2 0/7] clk: st: clkgen-pll: Add cleanup in clkgen_c32_pll_setup() and clkgen_odf_register() Haoxiang Li
2026-01-21  1:22 ` [PATCH v2 1/7] clk: st: clkgen-pll: Fix a memory leak in clkgen_odf_register() Haoxiang Li
2026-01-21  9:30   ` Markus Elfring
2026-01-21  1:22 ` [PATCH v2 2/7] clk: st: clkgen-pll: Rename clk variable in clkgen_c32_pll_setup() Haoxiang Li
2026-01-21  9:41   ` Markus Elfring
2026-01-21  1:22 ` [PATCH v2 3/7] " Haoxiang Li
2026-01-21  9:48   ` Markus Elfring
2026-01-22 23:37   ` Brian Masney
2026-01-21  1:22 ` [PATCH v2 4/7] clk: st: clkgen-pll: Add iounmap() " Haoxiang Li
2026-01-21 10:03   ` Markus Elfring [this message]
2026-01-21  1:22 ` [PATCH v2 5/7] clk: st: clkgen-pll: Add clk_unregister for pll_clk " Haoxiang Li
2026-01-21  1:22 ` [PATCH v2 6/7] clk: st: clkgen-pll: Remove redundant kfree() " Haoxiang Li
2026-01-21  1:22 ` [PATCH v2 7/7] clk: st: clkgen-pll: Add clk_unregister for odf_clk " Haoxiang Li
2026-01-21 10:15   ` Markus Elfring

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=398b4dab-ee76-44f4-9bfd-4388af954808@web.de \
    --to=markus.elfring@web.de \
    --cc=bmasney@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=stable@vger.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

all inboxes | Powered by JetHome®