From patchwork Tue Jul 19 09:52:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang He X-Patchwork-Id: 591786 Return-Path: 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 B5EC4C43334 for ; Tue, 19 Jul 2022 09:52:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233526AbiGSJw1 (ORCPT ); Tue, 19 Jul 2022 05:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiGSJw0 (ORCPT ); Tue, 19 Jul 2022 05:52:26 -0400 Received: from mail-m963.mail.126.com (mail-m963.mail.126.com [123.126.96.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30EED55B4 for ; Tue, 19 Jul 2022 02:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=qtuWz fYXdNmS2pAoRs13wnqDxu76zXli7AufO2gvSYs=; b=Wro8qj5VZupZgJmO+eMoJ ILAzibx7xLmchlLRYrG9Qm1b0FiiLHBGqOe8FD7m/03xOnZw6zIruCtsFoEz2z5o QUE2nogsEbiZWxm2VC0zmiwJWsbvQ1IGJdU39EoPPOlTerE69vmh6jPCY3DwIOAS 9mj/68Bd3ZxtEoexRjcqpM= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp8 (Coremail) with SMTP id NORpCgDXuF3RftZinYuJIA--.1515S2; Tue, 19 Jul 2022 17:52:18 +0800 (CST) From: Liang He To: rric@kernel.org, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, windhl@126.com Subject: [PATCH 1/2] mmc: cavium-octeon: Add of_node_put() when breaking out of loop Date: Tue, 19 Jul 2022 17:52:15 +0800 Message-Id: <20220719095216.1241601-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: NORpCgDXuF3RftZinYuJIA--.1515S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruw4DArWxCryxXFykXr17Awb_yoW3KFb_uF 47XF9xXF4xAFW2q3Z3Kr4Sv34IkwnY9r18XF18trWFqFy5Zw15Xas3ZryDJr1Uu3yDZFZ8 Cwn3Kr47AayfCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRKFApDUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbiuBJDF2JVkbjuvgAAsw Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org In octeon_mmc_probe(), we should call of_node_put() when breaking out of for_each_child_of_node() which has increased and decreased the refcount during each iteration. Fixes: 01d95843335c ("mmc: cavium: Add MMC support for Octeon SOCs.") Signed-off-by: Liang He Acked-by: Robert Richter Acked-by: Robert Richter --- drivers/mmc/host/cavium-octeon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/cavium-octeon.c b/drivers/mmc/host/cavium-octeon.c index 2c4b2df52adb..12dca91a8ef6 100644 --- a/drivers/mmc/host/cavium-octeon.c +++ b/drivers/mmc/host/cavium-octeon.c @@ -277,6 +277,7 @@ static int octeon_mmc_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Error populating slots\n"); octeon_mmc_set_shared_power(host, 0); + of_node_put(cn); goto error; } i++; From patchwork Tue Jul 19 09:52:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang He X-Patchwork-Id: 592319 Return-Path: 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 B54C7C43334 for ; Tue, 19 Jul 2022 09:52:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234739AbiGSJw3 (ORCPT ); Tue, 19 Jul 2022 05:52:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiGSJw2 (ORCPT ); Tue, 19 Jul 2022 05:52:28 -0400 Received: from mail-m963.mail.126.com (mail-m963.mail.126.com [123.126.96.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A37B55B4 for ; Tue, 19 Jul 2022 02:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=0oT95 6jqtnm5daxYu+PVgmXmnNLYvx8AxjjhOf4nbMw=; b=g40MQlqhD1Ul9dpC1a6xT EJp12DlZ1tRw5YPZq641OhJCUyuK1s3UU9jOa8P7LXitdOXU+VqaTZU87mcKplUj sP1Cl3cShQR3+h8z4yuNi0pSgEAPd8HEVLdt4fF5YOxRn2JeJjkwNXVidIYVWLSN ybvgzCz/jfMaN55GiGXtDM= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp8 (Coremail) with SMTP id NORpCgDXuF3RftZinYuJIA--.1515S3; Tue, 19 Jul 2022 17:52:19 +0800 (CST) From: Liang He To: rric@kernel.org, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, windhl@126.com Subject: [PATCH 2/2] mmc: cavium-thunderx: Add of_node_put() when breaking out of loop Date: Tue, 19 Jul 2022 17:52:16 +0800 Message-Id: <20220719095216.1241601-2-windhl@126.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220719095216.1241601-1-windhl@126.com> References: <20220719095216.1241601-1-windhl@126.com> MIME-Version: 1.0 X-CM-TRANSID: NORpCgDXuF3RftZinYuJIA--.1515S3 X-Coremail-Antispam: 1Uf129KBjvdXoWruw4DArWxCryxXFyDZFW7CFg_yoWfXFbE93 ZxXF9rJr17Jry29wn7Kr4Sq34rtwsY9r4xGryktr45Wa18Arn8WayvvFykJw1UZrWDuF9x CrnIyr4xArWYyjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xREb183UUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi7RJDF1pEAbSqsQABsa Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org In thunder_mmc_probe(), we should call of_node_put() when breaking out of for_each_child_of_node() which has increased and decreased the refcount during each iteration. Fixes: 166bac38c3c5 ("mmc: cavium: Add MMC PCI driver for ThunderX SOCs") Signed-off-by: Liang He --- drivers/mmc/host/cavium-thunderx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c index 76013bbbcff3..202b1d6da678 100644 --- a/drivers/mmc/host/cavium-thunderx.c +++ b/drivers/mmc/host/cavium-thunderx.c @@ -142,8 +142,10 @@ static int thunder_mmc_probe(struct pci_dev *pdev, continue; ret = cvm_mmc_of_slot_probe(&host->slot_pdev[i]->dev, host); - if (ret) + if (ret) { + of_node_put(child_node); goto error; + } } i++; }