Commit bc463201 authored by Johan Hovold's avatar Johan Hovold Committed by Georgi Djakov

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: e39bf297 ("interconnect: icc-rpm: Support child NoC device probe")
Cc: stable@vger.kernel.org      # 5.17
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230306075651.2449-7-johan+linaro@kernel.orgSigned-off-by: default avatarGeorgi Djakov <djakov@kernel.org>
parent 174941ed
...@@ -541,8 +541,11 @@ int qnoc_probe(struct platform_device *pdev) ...@@ -541,8 +541,11 @@ int qnoc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, qp); platform_set_drvdata(pdev, qp);
/* Populate child NoC devices if any */ /* Populate child NoC devices if any */
if (of_get_child_count(dev->of_node) > 0) if (of_get_child_count(dev->of_node) > 0) {
return of_platform_populate(dev->of_node, NULL, NULL, dev); ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret)
goto err;
}
return 0; return 0;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment