From: Johan Hovold Date: Mon, 6 Mar 2023 07:56:34 +0000 (+0100) Subject: interconnect: qcom: rpm: fix probe child-node error handling X-Git-Tag: baikal/mips/sdk6.1~69 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a1292196b69c3f1ce2d05e7ff2d532219134fd1a;p=kernel.git interconnect: qcom: rpm: fix probe child-node error handling commit 9eedc321e35b6a87e57149f237ea02c28896ef5d upstream. Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: 2b61e2442823 ("interconnect: icc-rpm: Support child NoC device probe") Cc: stable@vger.kernel.org # 5.17 Reviewed-by: Konrad Dybcio Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230306075651.2449-7-johan+linaro@kernel.org Signed-off-by: Georgi Djakov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c index 39e43b9575998..b00df2048b7f1 100644 --- a/drivers/interconnect/qcom/icc-rpm.c +++ b/drivers/interconnect/qcom/icc-rpm.c @@ -544,8 +544,11 @@ regmap_done: platform_set_drvdata(pdev, qp); /* Populate child NoC devices if any */ - if (of_get_child_count(dev->of_node) > 0) - return of_platform_populate(dev->of_node, NULL, NULL, dev); + if (of_get_child_count(dev->of_node) > 0) { + ret = of_platform_populate(dev->of_node, NULL, NULL, dev); + if (ret) + goto err; + } return 0; err: