Message ID | 20230201101559.15529-10-johan+linaro@kernel.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-arm-msm-owner@vger.kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44CF7C636D6 for <linux-arm-msm@archiver.kernel.org>; Wed, 1 Feb 2023 10:16:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232135AbjBAKQi (ORCPT <rfc822;linux-arm-msm@archiver.kernel.org>); Wed, 1 Feb 2023 05:16:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbjBAKQe (ORCPT <rfc822;linux-arm-msm@vger.kernel.org>); Wed, 1 Feb 2023 05:16:34 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25AB14A201; Wed, 1 Feb 2023 02:16:34 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ADA766174F; Wed, 1 Feb 2023 10:16:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F9CFC43333; Wed, 1 Feb 2023 10:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675246592; bh=mqziYJjbUJWRSrSis2BnZ/Mf5KJ1u6GxjZvx9Ve+zPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozmPnh0zuEX8o8cW1apdzCQl7iSQyb6OBgw2hPYohridr9xUab/CYR0/b76VkvvE4 Y++k5mAdhubXECg3DnqJet03UCXSrmWz201eXAlwUqhZnSykDE5sw/+X1AKcE7tjP6 j5Ru+UEbaLANRx+/0JnfbeXePmIgDqxC+czEAKvvWWC4fDqOiEW/5eRMGJgr9oRmel VqIpoYDAQgNlNmlyQBaCuRsZP2Yr0TWeFPlxsJwA2q9ZjPKm6ohoMt6Gd73A9gi0iy X3K5ErtUUXlY4OubsXV2M2Vmwd40Kts58eapjmE+56Onm7IxYLzqZxeFu7usCuuHfP bPNiUnIL2Q7Rg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from <johan+linaro@kernel.org>) id 1pNAAf-000441-Ow; Wed, 01 Feb 2023 11:16:53 +0100 From: Johan Hovold <johan+linaro@kernel.org> To: Georgi Djakov <djakov@kernel.org> Cc: Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Sylwester Nawrocki <s.nawrocki@samsung.com>, =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= <a.swigon@samsung.com>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, stable@vger.kernel.org, Luca Weiss <luca.weiss@fairphone.com> Subject: [PATCH 09/23] interconnect: qcom: rpmh: fix probe child-node error handling Date: Wed, 1 Feb 2023 11:15:45 +0100 Message-Id: <20230201101559.15529-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230201101559.15529-1-johan+linaro@kernel.org> References: <20230201101559.15529-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-arm-msm.vger.kernel.org> X-Mailing-List: linux-arm-msm@vger.kernel.org |
Series |
interconnect: fix racy provider registration
|
expand
|
diff --git a/drivers/interconnect/qcom/icc-rpmh.c b/drivers/interconnect/qcom/icc-rpmh.c index fd17291c61eb..5168bbf3d92f 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:
Make sure to clean up and release resources properly also in case probe fails when populating child devices. Fixes: 57eb14779dfd ("interconnect: qcom: icc-rpmh: Support child NoC device probe") Cc: stable@vger.kernel.org # 6.0 Cc: Luca Weiss <luca.weiss@fairphone.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> --- drivers/interconnect/qcom/icc-rpmh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)