Skip to content

Commit bc46320

Browse files
jhovoldGeorgi Djakov
authored andcommitted
interconnect: qcom: rpm: fix probe child-node error handling
Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: e39bf29 ("interconnect: icc-rpm: Support child NoC device probe") Cc: [email protected] # 5.17 Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Georgi Djakov <[email protected]>
1 parent 174941e commit bc46320

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/interconnect/qcom/icc-rpm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,11 @@ int qnoc_probe(struct platform_device *pdev)
541541
platform_set_drvdata(pdev, qp);
542542

543543
/* Populate child NoC devices if any */
544-
if (of_get_child_count(dev->of_node) > 0)
545-
return of_platform_populate(dev->of_node, NULL, NULL, dev);
544+
if (of_get_child_count(dev->of_node) > 0) {
545+
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
546+
if (ret)
547+
goto err;
548+
}
546549

547550
return 0;
548551
err:

0 commit comments

Comments
 (0)