Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp666619iog; Thu, 30 Jun 2022 08:01:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ua5xiijbOytxk08vDLpWy2YTMyarrMBQI7UGi66WJAGNnrbQofs6KqdLm//91qjG8zNefm X-Received: by 2002:a17:902:8b8a:b0:16b:b560:da62 with SMTP id ay10-20020a1709028b8a00b0016bb560da62mr1308857plb.20.1656601266587; Thu, 30 Jun 2022 08:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656601266; cv=none; d=google.com; s=arc-20160816; b=ZVi1OmeJ1x0CMUA8wVox6Ja33EmaZjJ6K7vRYHZ5iAWGs5/1PaKXtgqiavCbCUAKZb bKUAS9xQO2ou0WSDnyhEmkymM6kDSy4dkpfOa0go1iA1Be6zZNz1So/bMDoPrVb6YkXr /ydLgmZX7aW4l+vsX3dcWxHGud5UYOTf0yf9pOkEQaZqEjvEJ5v+oyKzLZWOeJ/TAPu/ 4qUK4hehsymZEc4g/MLTMGHm8uffI+f/T6QzqwFYAq8xvTPcId4hVCUSvFpou0UccOgS 4GqChra+69PU2vJ893IYfET5axDN84YAKVtEG5xE1/jFyFwQxinbTZK7M6Q4gAyVTein fHww== 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=EuEP4AytxTLCB560+T8sylFeyPip37mc8vrWBIc2kxg=; b=yBdQZ17aViMbSMpoULNJqfk6xemGNCpXm7Y35lBrWd34DY+AKsQjkpB+Cdez3f39JD hTjSdgZ955C+YJB+LTbKbzuOi5TjF3kZ/Up807ju5sPjKFjXdzu+3alu6hBSvct3NVxI AQ95BjUpDQoUqDdoC3vahHtolqy0+fv4VT/3YaBzTYZ84NqsWiZntSIA1Y6bdHy5FXVq JI4HOpWM+07cCl9WrXZaazG5EPQ6cim9ZGDbK01k36kBmtN1KSTgdNI8ePcXByNyLJlX ENaByqKVbwBG++Bs3NoHeNcliZ8RLVVJ31K/UYmtcZRKd3QZmhN9fq3jNqyOXr9/UAsr mJ9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="r/bl2vSX"; 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 k9-20020aa788c9000000b00525576117fbsi7347208pff.360.2022.06.30.08.00.51; Thu, 30 Jun 2022 08:01:06 -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="r/bl2vSX"; 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 S235507AbiF3Nt1 (ORCPT + 99 others); Thu, 30 Jun 2022 09:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235358AbiF3Nsb (ORCPT ); Thu, 30 Jun 2022 09:48:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC11964E8; Thu, 30 Jun 2022 06:48:26 -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 CB5F5B82AED; Thu, 30 Jun 2022 13:48:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 188C6C34115; Thu, 30 Jun 2022 13:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656596903; bh=SIMiUVob+dd9u0/AVhftthNtqULRglDZgMH8b1w4/Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r/bl2vSX6nuP6ErR/mERedoy0LNwFeVU0qQUaNJhvH4nRhVWZjfzaYSyexY3ikET7 j6GCx1ww13Gza9WOs92h5y0LMpwTRMCLEeC+dj02Lo2U+wLT2JDEZrX2PP1z2e8gOJ SQ6b9tEVaUFHSC8eC2qntkE7oiOgYIqFGpG1Y/+M= 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 4.9 22/29] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Date: Thu, 30 Jun 2022 15:46:22 +0200 Message-Id: <20220630133231.853523469@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133231.200642128@linuxfoundation.org> References: <20220630133231.200642128@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 @@ -379,6 +379,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)) { @@ -392,6 +393,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;