[PATCH 2/4] pmdomain: rockchip: fix clock leak on domain probe failure

Sebastian Reichel sebastian.reichel at collabora.com
Tue Sep 22 07:46:20 PDT 2026


Hi,

On Sun, Sep 20, 2026 at 09:15:52AM +0800, Shawn Lin wrote:
> Hi Sebastian
> 
> 在 2026/09/19 星期六 8:13, Shawn Lin 写道:
> > Hi Sebastian
> > 
> > 在 2026/09/19 星期六 1:21, Sebastian Reichel 写道:
> > > Hi,
> > > 
> > > On Fri, Sep 18, 2026 at 08:07:36PM +0800, Shawn Lin wrote:
> > > > When of_clk_get() failed in the middle of the loop, the references of
> > > > the clocks acquired so far were leaked instead of being released by
> > > > the error path.
> > > > 
> > > > Fixes: d909072d0521 ("soc: rockchip: power-domain: use clk_bulk APIs")
> > > > Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
> > > > ---
> > > 
> > > Right, but this should switch
> > > 
> > > pd->clks = devm_kcalloc(...);
> > > 
> > > to
> > > 
> > > pd->clks = devm_kzalloc(...);
> > > 
> > > at the same time to ensure that clk_bulk_put() does not run over
> > > non-initialized data. Otherwise
> > 
> > Good catch, will improve it in v2.
> > 
> 
> I was too quick to response, but didn't looked into devm_kcalloc, just
> guess it didn't zero the data from the name. However it does zero the
> data by passing in __GFP_ZERO. So I need to respin v3 and drop
> devm_kzalloc change.

Sorry about that detour.

Greetings,

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20260922/a4efe125/attachment.sig>


More information about the Linux-rockchip mailing list