Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp35462iog; Thu, 16 Jun 2022 20:58:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+gEvTpkxRks0RBT2mFI4PDDOZnAM6pC4nJtqXjekmUnWgCT86rQ+fULgXe57LX+67TrFv X-Received: by 2002:a17:906:cc88:b0:713:dd68:c651 with SMTP id oq8-20020a170906cc8800b00713dd68c651mr7374548ejb.16.1655438282502; Thu, 16 Jun 2022 20:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655438282; cv=none; d=google.com; s=arc-20160816; b=J4TdAUeoFgEyFjJvWbhtjm6CBHbFTr2sCelLK0c47qs4b1bDyv1g8cWwiJkaVo4+HD hVJZ1CCATmAHmk9/EruzLXodhSdtLrEn3n3Ann6Rg9kaTNTUnHWEm6zlP5alXBPVLUhk /UWfm2Rknm37dggnorgdE3tmwg/D5iay4ZSxMphHdhwdA+aFG1Fe2VHW3iaQkU6xbzCw hNZaaXkR6O3d2FIm/hH+/7xdDV816E8Wo7Pp1W3MtiZHBmkN9r53yJPbNgt8/IvpFRt7 JUtxJbmsQa7amufOf8A5VjjxFIgo3awLLaMrvo7YpgyO7XYZIvuIIakDR1x0CO6fWvRI GFBg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=FK3+6hlQB3HGXoQhyC6dprNvmAP51TusZx/O2PywBRE=; b=zDv37ii0j1Gl5IBKCm5TOoKchywErCZenb3kL0pPbzYglJcniRtsgcncOke9NMXftB 5GNJiGwgxfN6MZ4rTk0+2flVYv/SVQ7wHhz8D08NJMNqkTAKQCo9WtD8JwC53HM6ML/o upENKOipDO/pbuVV1JkI2M1NAWw5Nj+rHtxC9DqLzV4reTE+QBObUi3Y7eS4n8BneehB kG/tHYC7kHLYDKaAvRPh1uQiEfKKP/C/IfocgWgCCPrt/H5U3EjyNA9zeGH2ZKYyI+j1 L++eOrVR3pTLrHZAJlS1YLntxydWzBRodP/nykgm2Wk4c99us32gv+ztrcupsNJ9Bv+q g9JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=UWafGE1U; 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=126.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh9-20020a1709076e8900b0071d94f55dd2si96015ejc.203.2022.06.16.20.57.37; Thu, 16 Jun 2022 20:58:02 -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=@126.com header.s=s110527 header.b=UWafGE1U; 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=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379788AbiFQD4Z (ORCPT + 99 others); Thu, 16 Jun 2022 23:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231650AbiFQD4W (ORCPT ); Thu, 16 Jun 2022 23:56:22 -0400 Received: from mail-m963.mail.126.com (mail-m963.mail.126.com [123.126.96.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7B5565408 for ; Thu, 16 Jun 2022 20:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=FK3+6 hlQB3HGXoQhyC6dprNvmAP51TusZx/O2PywBRE=; b=UWafGE1UiUdqxOtFRJ1tx PJYNaoA6tu9+k2wp6y2wvijB1R4W67Xni+Miw+8cbNisIho0StWZxTqdfiNQKrho 0iI56/xxFwV3vjZ57TA7mvHiCGwwkLNAVEDTptvfHbjxiEDanJdZ+ADl0quZVKex arCWJuFt98w3/H3Z1YikgQ= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp8 (Coremail) with SMTP id NORpCgAHu49F+6tiYaBRFw--.26457S2; Fri, 17 Jun 2022 11:55:57 +0800 (CST) From: Liang He To: tony@atomide.com, linux@armlinux.org.uk Cc: windhl@126.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm: mach-omap2: omap4-common: Fix refcount leak bug Date: Fri, 17 Jun 2022 11:55:48 +0800 Message-Id: <20220617035548.4003393-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: NORpCgAHu49F+6tiYaBRFw--.26457S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruFyfGr18WFyxAryfuF4DJwb_yoWfJFgEqw n2g395Jrsag3Z3Ka47Ca15Gr4jgw1rWrs7W3s7ZF15Ka1UJr43ArZ2vas2yryDX3yrKrW3 ZFZFyw4Fkw1avjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUVWlJUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi7Q0jF1pEANzlIQAAsS X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 In omap4_sram_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He --- arch/arm/mach-omap2/omap4-common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index 6d1eb4eefefe..e981bf57e64f 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -135,6 +135,7 @@ static int __init omap4_sram_init(void) pr_warn("%s:Unable to allocate sram needed to handle errata I688\n", __func__); sram_pool = of_gen_pool_get(np, "sram", 0); + of_node_put(np); if (!sram_pool) pr_warn("%s:Unable to get sram pool needed to handle errata I688\n", __func__); -- 2.25.1