Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

authored by

Christophe JAILLET and committed by
Abel Vesa
156624e2 317e69c4

+4 -2
+4 -2
drivers/clk/imx/clk-imx8-acm.c
··· 279 279 280 280 for (i = 0; i < dev_pm->num_domains; i++) { 281 281 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 + } 284 286 285 287 dev_pm->pd_dev_link[i] = device_link_add(dev, 286 288 dev_pm->pd_dev[i],