mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
soc: imx8m: Fix error handling for clk_prepare_enable()
imx8m_soc_prepare() directly returns the result of clk_prepare_enable(), which skips proper cleanup if the clock enable fails. Check the return value of clk_prepare_enable() and release resources if failure. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202601111406.ZVV3YaiU-lkp@intel.com/ Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
parent
4acaf8b293
commit
f6ef3d9ff8
|
|
@ -148,7 +148,11 @@ static int imx8m_soc_prepare(struct platform_device *pdev, const char *ocotp_com
|
|||
goto err_clk;
|
||||
}
|
||||
|
||||
return clk_prepare_enable(drvdata->clk);
|
||||
ret = clk_prepare_enable(drvdata->clk);
|
||||
if (ret)
|
||||
goto err_clk;
|
||||
|
||||
return 0;
|
||||
|
||||
err_clk:
|
||||
iounmap(drvdata->ocotp_base);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user