All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: j.ne@posteo.net
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Tao Lan <taolan@huawei.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clk: hisilicon: Improve deallocation in error path
Date: Wed, 4 Mar 2026 10:00:15 -0500	[thread overview]
Message-ID: <aahI_4lfMdQjZCu3@redhat.com> (raw)
In-Reply-To: <20260303-hisi-error-v2-1-7cd9b43d8fbb@posteo.net>

On Tue, Mar 03, 2026 at 04:25:18PM +0100, J. Neuschäfer via B4 Relay wrote:
> From: "J. Neuschäfer" <j.ne@posteo.net>
> 
> Unmap 'base' if an error occurs after it has been mapped.
> 
> Reported-by: Tao Lan <taolan@huawei.com>
> Closes: https://lore.kernel.org/lkml/ZNlSH+eWV8Sk3FYn@probook/
> Signed-off-by: J. Neuschäfer <j.ne@posteo.net>

My understanding is that you need to use your full first name in the
Signed-off-by.

> ---
> Changes in v2:
> - Rebase on v7.0-rc2
> - Update my email address
> - Reword the commit message somewhat
> - Link to v1: https://lore.kernel.org/r/20240708-hisi-error-v1-1-727bc7399b63@gmx.net
> ---
>  drivers/clk/hisilicon/clk.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
> index fae65127cd4aa8..08050ff1c8cf9a 100644
> --- a/drivers/clk/hisilicon/clk.c
> +++ b/drivers/clk/hisilicon/clk.c
> @@ -70,7 +70,7 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np,
>  
>  	clk_data = kzalloc_obj(*clk_data);
>  	if (!clk_data)
> -		goto err;
> +		goto err_base;
>  
>  	clk_data->base = base;
>  	clk_table = kzalloc_objs(*clk_table, nr_clks);
> @@ -83,6 +83,8 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np,
>  	return clk_data;
>  err_data:
>  	kfree(clk_data);
> +err_base:
> +	iounmap(base);

Use devm_of_iomap() and it will be automatically cleaned up for you.

Brian


  reply	other threads:[~2026-03-04 15:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 15:25 [PATCH v2] clk: hisilicon: Improve deallocation in error path J. Neuschäfer
2026-03-03 15:25 ` J. Neuschäfer via B4 Relay
2026-03-04 15:00 ` Brian Masney [this message]
2026-03-05  9:02   ` J. Neuschäfer
2026-03-05 11:11     ` Brian Masney
2026-04-29  3:53 ` 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=aahI_4lfMdQjZCu3@redhat.com \
    --to=bmasney@redhat.com \
    --cc=j.ne@posteo.net \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=taolan@huawei.com \
    /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.