]> git.baikalelectronics.ru Git - kernel.git/commitdiff
interconnect: qcom: rpm: fix probe child-node error handling
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 6 Mar 2023 07:56:34 +0000 (08:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:57 +0000 (13:33 +0100)
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 <konrad.dybcio@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230306075651.2449-7-johan+linaro@kernel.org
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/interconnect/qcom/icc-rpm.c

index 39e43b9575998d1dc07ce881a66affb9120b4e5a..b00df2048b7f19c1aee993824869bf4e0b0767c5 100644 (file)
@@ -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: