Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1858543rwb; Fri, 19 Aug 2022 10:33:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jdABvYJSQbYx4ASC6MT6grlE/sqA1drqsp+3Yiv1BDlS1l8Kf6wkTSSiQR5rXZ/0FLBJu X-Received: by 2002:a63:6884:0:b0:415:b761:efa4 with SMTP id d126-20020a636884000000b00415b761efa4mr7276798pgc.274.1660930394333; Fri, 19 Aug 2022 10:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930394; cv=none; d=google.com; s=arc-20160816; b=FHM6CFr8JeYF6FR+4FbrqxFN9xZwfGdxO0zynlKBsD1yqG4L3iYTUk7NgGN7GGXmwH G7Rt3HUtuM7GY9biH85/AfqaqxV9Yo/yGKAO0BGAg2x7ikPe/2GIJot4dz9Hzd4uNruU u6IoHBPROoCOV1qc8ZXNOFcHW6PKLJHVFB0B6RTLODH05elOQpAV732MDAnLosHO8Dxs 2+fKVPqnbfnDcG9UQTI9PgAxLokLvCUMC4UTBwxykgfmUb8poodhrtgohc9NTdVEPw/f 4w7Wk9tSLvPIrB+0xXR73E8j22dW5WgNfqa0/Mq2QryzKvtYomwtdDMbWRvQRYWCZLBk yl7w== 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=AvjndlGoxHi6VxjgnRSqk0M3WcGBfSHOCV7wZlJOg34=; b=pkkaWba0yMleA4xS/WVNETIruLASLKIWdWeswP/kaS8ukdtol+AVCfB+Dmuq9isQj2 bO9VxR+bparRNDspM9+LtlOoHpo8MzE5S5htvF96Kr9i0OI4w6fKSlL4a7BsPEQ7n3J6 STn5YNYpHWbmHWAmM+urLhUb/XxG0N6oETeYNOPKJQUxXi/QHP1k+WE0g8Koslc5v9k9 SH0EErEMsOOqqotv97tAOY74X7spQXnvkOUGTI1a48lbVewAMwmK9lNn0M2BbFMCMMzk ZyoyU33K5Y/pn9KBfuuCLC8KB2eeDHImW2C6RpraYxsCzXdHCtv0Uldg1sCynPxUF0y2 /ayg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gKJUuOHu; 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 q68-20020a634347000000b00429f677c808si4669811pga.518.2022.08.19.10.33.03; Fri, 19 Aug 2022 10:33:14 -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=gKJUuOHu; 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 S1352815AbiHSQ2Q (ORCPT + 99 others); Fri, 19 Aug 2022 12:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352718AbiHSQZY (ORCPT ); Fri, 19 Aug 2022 12:25:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 927884DB41; Fri, 19 Aug 2022 09:03:19 -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 47D4761698; Fri, 19 Aug 2022 16:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44C8FC433C1; Fri, 19 Aug 2022 16:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924998; bh=njgtn/5vil/3SWQGkDVgSDn7wCT+1DXns7cLGzDpX1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gKJUuOHuy753EzjgGzx10A5Am9hf6GW2HFoJBYPuxgN0YbOtT1Z5zQdKz88zmGCVc W9mMnPY/vCbetvxRaP3ukMlnndr4/cwjgOlIXZBqXKpRdqySiedn6FyjZ6sd0JJ0P0 3dGArlXGEjKMNG0yaLyume8en7szDuq3m8Cn7oMM= 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 5.10 343/545] mmc: cavium-thunderx: Add of_node_put() when breaking out of loop Date: Fri, 19 Aug 2022 17:41:53 +0200 Message-Id: <20220819153844.746624238@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 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++; } -- 2.35.1