Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3408891rwa; Tue, 23 Aug 2022 04:24:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Yzirx6/zyrkUMw5rmdFyilSuPYag5FAulStHL3U+BDhXLUiUUcFZwC5u/OG5U8UsLFNj7 X-Received: by 2002:a65:46c7:0:b0:42a:c9db:cb7 with SMTP id n7-20020a6546c7000000b0042ac9db0cb7mr5263477pgr.515.1661253884323; Tue, 23 Aug 2022 04:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253884; cv=none; d=google.com; s=arc-20160816; b=KmkFVu1nnT8iwnizS722zZy3XTVLYfVb/LU5JcUoqNR6h9o6hxvDLfQxYwX7mgerCc +yqvUXh3d+pCj9kpnk2Nt1+nqsOrcRwfDz0bgrpJ93sPNHnWXgxV9oT3tCkU6H9uBMiR LdjbQGl1ZPc7Ih0chlVm4w8AW3U6S4Y6CgbL3uUM5vPqLZJkikvYUoyb5MIfhWG4gZav LOktcT9lbsuti9lZmz7il1iHPdiD8aELbcUd536T7o0tfwlaHhzH6nViMGfcqoi9WG8v eqC/54aIlJ89Zh0BePtG3o6S+sdiyuPwNlQVQ/STdY7ihCIoIb+V64c6oQZhbm5EVlhE 5WCQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B0LLf7AgLQBsDUGRC99BIb0z1R3MVAaNSpXPW0VfZ3U=; b=KyrbjcQkBSKGEhgx5gGbW45caPTgeIN+PxuHsvl09l0OGZ5G2L9JYOPSG4r2WljkL0 x4m+23Eed9FnWNVFNRaIuudEsVPGn94vrsi8F+WCrwKOlJxk3NVcUjV8p41jjmIOgZ99 QYumYPOsOHluLU914Gygq3pdjDhVGxZ4w5P46XVSMXD/B5N7NvUpsDe3xXkKnpXreEp3 14XM07PQ9BrHUPp7eC8Ajp1kAiefmEHd3lOITbx0b2+9FC2dz/IHgXuMiJNGj2GeFyQI tcKye0tWsqpWWrRuNUV1qJy/gMdrZVRVBNlT3haWMhbL9w+JxO5kUp063/TCP0WvZNRl WBOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gGu24JnU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw18-20020a17090b181200b001fb7350cd1dsi178081pjb.14.2022.08.23.04.24.33; Tue, 23 Aug 2022 04:24:44 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gGu24JnU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350254AbiHWKsB (ORCPT + 99 others); Tue, 23 Aug 2022 06:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356307AbiHWKlu (ORCPT ); Tue, 23 Aug 2022 06:41:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96D486709; Tue, 23 Aug 2022 02:09:24 -0700 (PDT) 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 003F1615AB; Tue, 23 Aug 2022 09:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E19E2C433C1; Tue, 23 Aug 2022 09:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245750; bh=/RaeS7m5dAmIU2S1dxom5JWgLdGUIw6c/w0E9WlM5zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gGu24JnU/bRQHwPm6m+mGiyqZyHYSz+apHX34yVSDK6B8RJvSrb43uErH8ihjafEe 5WiLBpP0bJBaxeRCdtk7fZo9NZYQIcqbDYNrmgGcZQ+mxSRHwcHsj4/lihgScW652g kdI3s0wEGmmF1JMfNwVnh5aW5TF3Fv64w6Fp/kPo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Robert Richter , Ulf Hansson , Sasha Levin Subject: [PATCH 4.19 137/287] mmc: cavium-thunderx: Add of_node_put() when breaking out of loop Date: Tue, 23 Aug 2022 10:25:06 +0200 Message-Id: <20220823080105.081402755@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Liang He [ Upstream commit 7ee480795e41db314f2c445c65ed854a5d6e8e32 ] 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 Acked-by: Robert Richter Link: https://lore.kernel.org/r/20220719095216.1241601-2-windhl@126.com Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- 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 eee08d81b242..f79806e31e7e 100644 --- a/drivers/mmc/host/cavium-thunderx.c +++ b/drivers/mmc/host/cavium-thunderx.c @@ -138,8 +138,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++; } -- 2.35.1