Re: [PATCH v2] clk/ingenic: fix clock leak on clk_register_clkdev failure

From: Greg KH

Date: Tue Jul 07 2026 - 00:27:37 EST


On Mon, Jul 06, 2026 at 03:59:06PM -0400, Brian Masney wrote:
> On Sun, Jun 28, 2026 at 08:28:11PM +0800, WenTao Liang wrote:
> > clk_register() succeeds but clk_register_clkdev() fails, and the error
> > path jumps to out without calling clk_unregister or clk_put to release
> > the registered clock. This leaks the clock object within the common clock
> > framework
>
>
> > , contrasting with the CGU_CLK_EXT type path which correctly
> > calls clk_put on error.
>
> I would drop this part. Just focus on what you are fixing.
>
> >
> > Suggested-by: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
>
> I don't see where on the v1 Greg suggested this, unless I am missing
> something?

I did not.

> > Fixes: b066303fb3e7 ("clk: ingenic: add driver for Ingenic SoC CGU clocks")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
> > ---
> > Changes in v2:
> > - Fix patch format based on reviewer feedback
>
> Link to v1: https://lore.kernel.org/linux-clk/20260626115644.33779-1-vulab@xxxxxxxxxxx/
>
> With those fixes:
>
> Reviewed-by: Brian Masney <bmasney@xxxxxxxxxx>

All of these need to be dropped until the submitter learns how to
properly submit things.

greg k-h