public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Dongjiu Geng <gengdongjiu@huawei.com>,
	Michael Turquette <mturquette@baylibre.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: hisilicon: hi3559a: Fix an erroneous devm_kfree()
Date: Wed, 21 Feb 2024 20:27:06 -0800	[thread overview]
Message-ID: <f8bf91a3fbbe213f0bf0e63aa7cdf86c.sboyd@kernel.org> (raw)
In-Reply-To: <773fc8425c3b8f5b0ca7c1d89f15b65831a85ca9.1705850155.git.christophe.jaillet@wanadoo.fr>

Quoting Christophe JAILLET (2024-01-21 07:16:24)
> 'p_clk' is an array allocated just before the for loop for all clk that
> need to be registered.
> It is incremented at each loop iteration.
> 
> If a clk_register() call fails, 'p_clk' may point to something different
> from what should be freed.
> 
> The best we can do, is to avoid this wrong release of memory.
> 
> Fixes: 6c81966107dc ("clk: hisilicon: Add clock driver for hi3559A SoC")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Applied to clk-next

About doing the right thing, it seems OK to remove the free for now
because the code continues on anyway.

      reply	other threads:[~2024-02-22  4:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 15:16 [PATCH] clk: hisilicon: hi3559a: Fix an erroneous devm_kfree() Christophe JAILLET
2024-02-22  4:27 ` Stephen Boyd [this message]

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=f8bf91a3fbbe213f0bf0e63aa7cdf86c.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gengdongjiu@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox