Skip to content

Commit 156624e

Browse files
tititiou36abelvesa
authored andcommitted
clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains()
If a dev_pm_domain_attach_by_id() call fails, previously allocated resources need to be released. Fixes: d3a0946 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Abel Vesa <[email protected]>
1 parent 317e69c commit 156624e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/imx/clk-imx8-acm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,10 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev,
279279

280280
for (i = 0; i < dev_pm->num_domains; i++) {
281281
dev_pm->pd_dev[i] = dev_pm_domain_attach_by_id(dev, i);
282-
if (IS_ERR(dev_pm->pd_dev[i]))
283-
return PTR_ERR(dev_pm->pd_dev[i]);
282+
if (IS_ERR(dev_pm->pd_dev[i])) {
283+
ret = PTR_ERR(dev_pm->pd_dev[i]);
284+
goto detach_pm;
285+
}
284286

285287
dev_pm->pd_dev_link[i] = device_link_add(dev,
286288
dev_pm->pd_dev[i],

0 commit comments

Comments
 (0)