Re: [PATCH] soc: imx8m: fix clock reference leak in imx8m_soc_prepare()

From: Felix Gu

Date: Tue Jun 30 2026 - 10:02:19 EST


Hi Peng,

On Mon, Jun 29, 2026 at 3:21 PM Peng Fan (OSS) <peng.fan@xxxxxxxxxxx> wrote:
> > platform_device *pdev, const char *ocotp_com
> >
> > ret = clk_prepare_enable(drvdata->clk);
> > if (ret)
> > - goto err_clk;
> > + goto put_clk;
> >
> > return 0;
> >
> > +put_clk:
> > + clk_put(drvdata->clk);
> > err_clk:
>
> It should be safe to directly put "clk_put" here, no
> need extra label.
Passing an error_ptr to clk_put() could invoke WARN_ON_ONCE.

Best regards
Felix
>
> Regards
> Peng.
>
> > iounmap(drvdata->ocotp_base);
> > return ret;
> >