bus: qcom-ebi2: Fix clock leak on probe failure

qcom_ebi2_probe() enables the EBI2X and EBI2 clocks before it walks
child nodes and populates child devices. If reading a child node's reg
property fails, or if of_platform_default_populate() fails, probe returns
without disabling either clock.

Route those failure paths through the existing clock cleanup labels so a
failed probe does not leave the clocks prepared and enabled.

Fixes: 335a127548 ("bus: qcom: add EBI2 driver")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Link: https://lore.kernel.org/r/20260620080406.1970447-1-ruoyuw560@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Ruoyu Wang 2026-06-20 16:04:06 +08:00 committed by Bjorn Andersson
parent ed3233af30
commit 64774dea58

View File

@ -353,7 +353,7 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
/* Figure out the chipselect */
ret = of_property_read_u32(child, "reg", &csindex);
if (ret)
return ret;
goto err_disable_clk;
if (csindex > 5) {
dev_err(dev,
@ -372,8 +372,12 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
have_children = true;
}
if (have_children)
return of_platform_default_populate(np, NULL, dev);
if (have_children) {
ret = of_platform_default_populate(np, NULL, dev);
if (ret)
goto err_disable_clk;
}
return 0;
err_disable_clk: