[PATCH] bus: qcom-ebi2: unwind clocks on child setup failures
From: Pengpeng Hou
Date: Tue Jun 16 2026 - 11:24:52 EST
qcom_ebi2_probe() enables both EBI2 clocks before walking child
chip-select nodes. A missing child reg property returns directly from
that loop, bypassing the existing clock-disable labels.
Route that failure through the existing unwind path. Also check the
final child population result, depopulate any partially created children,
and disable the clocks if population fails.
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
---
drivers/bus/qcom-ebi2.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index be8166565e7c..68fe931d1636 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -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,14 @@ 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) {
+ of_platform_depopulate(dev);
+ goto err_disable_clk;
+ }
+ }
+
return 0;
err_disable_clk:
--
2.43.0