Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2962975rwb; Sun, 20 Nov 2022 05:05:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4hshA8EE/0hNqdJELtTv6lJzP8YHrmYoW0Hfp7Hiwzb8na6ukVXz8WcNvclpA8UOdBVhWh X-Received: by 2002:a17:90a:4a85:b0:20a:dba9:ebe2 with SMTP id f5-20020a17090a4a8500b0020adba9ebe2mr22653674pjh.136.1668949554934; Sun, 20 Nov 2022 05:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668949554; cv=none; d=google.com; s=arc-20160816; b=InHIvnRSmdfS+n4CdSYvDrk741E9q3Qep9LHt50T6294RCZV/OJoRopvJolmNLWpRe hw3v8XOVQ0YKkBZE91hsMsCD11Gzc2+7Npam6qwY7E2SKANk6pOcUzyHJVBvvE/OO2mW LlmxFOO4y2uiNSva/D8iNvNziikwpSan1x85DM4aFPaGPCVfsTzEuXQKWN3ic/GYw5og ZR9j3jEcDDLkwtYO8AuDYV4k97SnXBCWhQVGkAkdxD3PkG/cDT05GHoowGaOkTSzNEgn ut8GVBCdSszww+nsbLA8YERZlQlcKDFEIoULax9A/gt+DYmsqQpMPI42NTk6O66+IMuD WmhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8PAWmW4pCdn9ryF8cQFs/v1qcaJMHMIlRf4tCBu8kI4=; b=qzkfjdXf+z9IFknnBySWTuXCXWY29PHxrKNRcJLpGCIiZQ1w10gIY/Bo153vqE62EW vRdEnrveXCnaV4WWUg4vnBGMUZ5MvZBYodpFXKpuibehbleiR/z2sQwNbB9GJtUEjqwr aSat3nj4ULbAty/orBhjk29krP3Lq1zNYCQxvnb29DR4y0SeGCp9uEH4SGzbLkpIJr/1 NWzy6ZTUlxUN760wHkhgogKwdyPxp2kDvCfqext4BSWsqpgAIB0Cacndhowke2Y1NMAV yVp0BX6CwT0yPw0EcRBla2+ypeTaV0g1nVS/A9BdFsqy4P16BoN+xNn5yEguY7xRN/Np 6Fqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv18-20020a17090b1b5200b0020900585fa2si13243493pjb.102.2022.11.20.05.05.35; Sun, 20 Nov 2022 05:05:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbiKTMfK (ORCPT + 92 others); Sun, 20 Nov 2022 07:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiKTMfJ (ORCPT ); Sun, 20 Nov 2022 07:35:09 -0500 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62DC3558F for ; Sun, 20 Nov 2022 04:35:07 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id wjXMofNQANKuIwjXMoFRmK; Sun, 20 Nov 2022 13:35:05 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 20 Nov 2022 13:35:05 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Georgi Djakov , Luca Weiss Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH] interconnect: qcom: icc-rpmh: Fix an error handling path in qcom_icc_rpmh_probe() Date: Sun, 20 Nov 2022 13:35:03 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If of_platform_populate() fails, some resources need to be freed as already done in the other error handling paths. Fixes: 57eb14779dfd ("interconnect: qcom: icc-rpmh: Support child NoC device probe") Signed-off-by: Christophe JAILLET --- drivers/interconnect/qcom/icc-rpmh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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: -- 2.34.1