From: Johan Hovold Date: Mon, 6 Mar 2023 07:56:37 +0000 (+0100) Subject: interconnect: qcom: rpmh: fix probe child-node error handling X-Git-Tag: baikal/mips/sdk6.1~67 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=58f77e03534cb1381804df9afa23b7a84d6f13ac;p=kernel.git interconnect: qcom: rpmh: fix probe child-node error handling commit f90d85e279fa0256a1496fb5b6cbe1c7b8803432 upstream. Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: 96c9807d4561 ("interconnect: qcom: icc-rpmh: Support child NoC device probe") Cc: stable@vger.kernel.org # 6.0 Cc: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20230306075651.2449-10-johan+linaro@kernel.org Signed-off-by: Georgi Djakov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index fd17291c61eb9..5168bbf3d92fc 100644 --- a/drivers/interconnect/qcom/icc-rpmh.c +++ b/drivers/interconnect/qcom/icc-rpmh.c @@ -235,8 +235,11 @@ int qcom_icc_rpmh_probe(struct platform_device *pdev) 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: