Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909993iog; Mon, 27 Jun 2022 05:34:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tfTxo9+4N9+wQA59rY44MCU3fAMFm2F+TTDPdGG+yRZJ/OqoZcG5HTHHzsDQQ2ET/1fEzV X-Received: by 2002:a17:906:4fd4:b0:722:f223:8d86 with SMTP id i20-20020a1709064fd400b00722f2238d86mr12527477ejw.558.1656333284646; Mon, 27 Jun 2022 05:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333284; cv=none; d=google.com; s=arc-20160816; b=YbM79A7DoMVWxpAU4i9VRt1ud5EIUyO4GWDg98wUcBiSf9uBe6aZB4m95qbtVxVu9C aL+859qvhbckVg9sAbDeZWmgJyBVz2xbeDq5YqdqmJBnRostgnIbN1rJwyAjivHtnq8+ z9aTffFBXzj9qpxgT9OqNf9IMmS/xUCOKj8V5/UiMnPHnHgo8JTgUDWnaHiIKQwZ78io eFNQSVvsxx/FwTHHvEvYEQrRMkT39nDgyUVHR8GtngrWQjOQ00+mb5rWBNASq245EwHS +sBdDvtUd3F1QxEu6IcQjFWANV0lq7RWxsp01pp4N2DrhDkSfkuo8EkvoCIp2cgkGLxb 3SBA== 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=iIkEm5ow87TIrT90wY9SfQUTq4SVsIzlxdIbdmR6ogw=; b=uUdOTlf5irwS0DDLt7E6P1RzYnuZ9dvB+qjqw8Fnpjn0qkTWlYchFFwRPKYfOFRVVH PvZiYvsc0lN6SfJR1u4AROrbIL5S7S+MWnfzYp2MacmK+YWPYL8i6rTmaLDMrpEttluX 2EGnQLc7UPJDyI8qWoQtRk5yLhO95aydm4hfY+9t7jmBayU/NsWpc+UC4xZP1IxoA902 lIzjzeFl/zdS5b4F43t6bVPzR9lRgL+biWsvuoQfug+hKn9JxaAdOI+1fmLKt34nNZ5L TZ8IabIovrFJ67M/uKOU8GvaB7FmtkzvNFWI/dSCtqU2pYTsA8pdoGaov/+ul27PfqUv 12Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IJZYSBPu; 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 nd2-20020a170907628200b007269faa3951si4179085ejc.978.2022.06.27.05.34.19; Mon, 27 Jun 2022 05:34: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=IJZYSBPu; 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 S233236AbiF0L3N (ORCPT + 99 others); Mon, 27 Jun 2022 07:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235351AbiF0L2W (ORCPT ); Mon, 27 Jun 2022 07:28:22 -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 D060DA18F; Mon, 27 Jun 2022 04:27:22 -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 6FDC3614A2; Mon, 27 Jun 2022 11:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C87CC3411D; Mon, 27 Jun 2022 11:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329241; bh=XD01nU63sTO0XqJJuZPfLOromHDSrYBbyMEACs/xTzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJZYSBPu0Q8JP/v2wBxuBMqx2+aNH5HT3Njg2M2NWJ52cybS3wBAfMLN4QtasJiy9 9IKb6XxKn9f3417UXg8JZMJdrrjZTpiMA13LYRbGBjHwTrTlRZa+2JATust3nr5obM ahQg9BxMf/iv54CJWtiaC0To3629aHi35mfaB+ls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Halasa , Arnd Bergmann Subject: [PATCH 5.10 098/102] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Mon, 27 Jun 2022 13:21:49 +0200 Message-Id: <20220627111936.373057683@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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: Miaoqian Lin commit 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 upstream. of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support") Signed-off-by: Miaoqian Lin Acked-by: Krzysztof Halasa Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-cns3xxx/core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/arm/mach-cns3xxx/core.c +++ b/arch/arm/mach-cns3xxx/core.c @@ -372,6 +372,7 @@ static void __init cns3xxx_init(void) /* De-Asscer SATA Reset */ cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA)); } + of_node_put(dn); dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci"); if (of_device_is_available(dn)) { @@ -385,6 +386,7 @@ static void __init cns3xxx_init(void) cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO)); cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO)); } + of_node_put(dn); pm_power_off = cns3xxx_power_off;