Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2906223iog; Mon, 27 Jun 2022 05:30:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1umoc1otk8TyVQ11mexlicAuznkhJQfipjO5x4595AKq8NuOWYOJa5RXrlpTBVCxWN9/HSo X-Received: by 2002:a05:6402:27c9:b0:435:d420:5ebb with SMTP id c9-20020a05640227c900b00435d4205ebbmr15922436ede.89.1656333046013; Mon, 27 Jun 2022 05:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333046; cv=none; d=google.com; s=arc-20160816; b=WZGLkonO51/vD2K/RkbKUM2KKbEWuZcf8BmdsM+Ewr9O5ZRLF5ib1NfJ/y61/atTfk fL+lVSgNA8Z5tmpiTB5SWeQRbfahoCpkmcLuy8pQ//RUhaCwI9OkRbDEXgxaM+MaHsL9 //2kbuzjWhoSJbTC9HvP7NjBhJVEKyWW6dLFDeFNzrGx5BNSJ1BIleTTQpee7SZWKbsK RufXvmmfHtHDdKO4s9hOHhZ4Q6Tg5CCIgmgXmUlelc2xYKyEwuiA2s/LpD8JRjaSCM4B PvvyyFwv7F58IDZqeabBQYp9kJbHw1JTksY1srZgjT2Ydh5RBv81tgarjDVEOxnJx5q1 etXw== 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=6NwFevHPbHceWJDAXFMkHj9Zzn5atNPdnPEBA457A7A=; b=ob3q3SUmi6N2QuILN9afOnIh9fjRHydkZPthQm7IKjXPv6O24mYJZSG//z9UdwwZSE mjjle81W2IFPFXfGtlOx5C/e+c/rl+/k9kwgb6vPOlHCs7vrTDRpzLrygKfh3e7rhDbO 0QT9GQYmSPhS35f8YPTjF8Khj7Ijd8V6CuRetd4iM0e+kuHyHuvqWTDQ7PJ6tbOTCY7+ yfwzZibIFyNIugZ2EroazPixGfFYFSroVTg27kH3qLfziHCy8iHs4CdIjL5VNl0XFmd3 ow0KpC/m4I2VnL+D18U4RSluzqSrZsNBH5najiQnP76ZNVURGFWkeCsn4U6jrzL0flUW qdBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="QFx/VgJv"; 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 nb5-20020a1709071c8500b0070d8de4e431si15081823ejc.206.2022.06.27.05.30.21; Mon, 27 Jun 2022 05:30:46 -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="QFx/VgJv"; 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 S235964AbiF0Ley (ORCPT + 99 others); Mon, 27 Jun 2022 07:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236168AbiF0LdY (ORCPT ); Mon, 27 Jun 2022 07:33:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BBF4CE11; Mon, 27 Jun 2022 04:30:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id BDD5BB81126; Mon, 27 Jun 2022 11:30:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356ACC341C7; Mon, 27 Jun 2022 11:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329426; bh=zbM+FiatcV99sgVVByCocxpD5uvDGwRXusMpryNERgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFx/VgJvB45RKMRVXkiUK8Wqr644aSFYCUXrl3IdJPQyU5x0RX6+w45cPr4K6nh+O uvOmVdhUQ0gb+taD8tGbeaNxGhx2Tl8elDYVWTze6+TJ2zR8M0ouuf1C5L2SqM0rvG xvOYKG1/Jjh85/mfbZpp9bVw+A1yhMcaXXJcGug0= 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.4 56/60] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Mon, 27 Jun 2022 13:22:07 +0200 Message-Id: <20220627111929.338371319@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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 @@ -376,6 +376,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)) { @@ -389,6 +390,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;