Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3222059rdb; Wed, 13 Sep 2023 06:04:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyDueEDnNmOqCzJosdqaxcYCNOUhMQ3Lrvef3p1WY2M136KiapspHGa6KkLKC3t8et0cdw X-Received: by 2002:a17:903:41cb:b0:1c3:c5b5:8a83 with SMTP id u11-20020a17090341cb00b001c3c5b58a83mr3193354ple.4.1694610247397; Wed, 13 Sep 2023 06:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694610247; cv=none; d=google.com; s=arc-20160816; b=DyNlZR6t/cyrV4YpqkdE0LE4aE2lhfNwNC4c7p7vnQS1rkeH/9kHSFjMOGYmFn4SuM egswUiUCgvb47jyQ1bZt7rI9z4J8wKL3LcAywKgQaUfGcU9Rhf6iigRTDVdMeQzqppfK /ifuIZ8fLvussz+teeNjaK6xLc+1P2ji5r4jkvfv7pyT6KokdKaWy87d6010Vh41G/gB zT4jpEiUEqenPBU6FY04T2gCTjHUqkz/I7w7WGB9BmK29i9kN0MhgQd372IfIXei5za8 TfUpHT8G3/IBwnlkL+xgjR8OY2uoKPWpqu3JCJ6TiwKxloGimprg9/jIKrKiNu0Q5wi2 AiDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ty2Mx8Hgrdu2bsosB/vzMcYyjV5NHL+n5v4K4klF3mA=; fh=zC2Gfnc+9Hlee8VwZektwIeg718/FibMwAn7Ulm1Lm0=; b=Ppo6FbAETvsMy2RJnhZ1B7bU4Mk1U+V2f1MTe+7YjiWAk3GuKXufWkh39pDUnrV0Xg vkAJ0+V360BALSyVzDdsfCT08Mfjb70ASfKwDNkRda24uP0TT7q6K1bWvaOqCSejPggw 4ymZy/q/7Oh7oblU7do5Xhnw3BtAGXJalb7Q27Hf1QE+HlcyOdqIntPM25YM963ukeOH C/OtpNPwM8v6dpRaaF4WZMj2pOvqLKyPoNwb5nqaRhiH42DkuKcBg/kZL6IecDTk6qy7 x73VmebEbpVYwqMiYWolkg4XX63aej7PJW5mMpGeIESc4HJaI1sRXybWWNVrqY28mIBI QFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eBwi1wzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z11-20020a170903018b00b001bf1a9dbcc9si10589858plg.549.2023.09.13.06.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eBwi1wzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0497D81DE5BC; Wed, 13 Sep 2023 06:01:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233534AbjIMNBf (ORCPT + 99 others); Wed, 13 Sep 2023 09:01:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbjIMNBe (ORCPT ); Wed, 13 Sep 2023 09:01:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 658B51989 for ; Wed, 13 Sep 2023 06:01:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C846C433C8 for ; Wed, 13 Sep 2023 13:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694610090; bh=9VsP3SfBCgbMmQLBpB/Uo49Wn9M5w2DLBgBZIQ+HGZY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eBwi1wzuMcJHorOJFaidjvD1g0sslam5fE0VCNZnON9u86OwI8LlZMgo5btiA7NIz aKZK97qXupU2Owa2R8oW+fJcsRfETAu3anhuTFqEXLDBrV8K4ggG7NZRxr55sYk1Lz BB5dblB6lPWF7p7zqGn6gf5gPQtHQ9D85MXQe1oushCZB9p2677+X4pXEZ/t6p8Ze4 KPqkDSOMpYCPLG7rtLf/DweQ417zEmMipsbqUfN4R20MOnrl5c/3HNkSeOv7kq9dO2 PSU3EktjrIsOdGXIAgpcEHBp0efaEiSjQTQt3l0MWnIcsgdx2URSg27NqhDmXicyIj qOI5bPYzRiZQw== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-500cfb168c6so11145901e87.2 for ; Wed, 13 Sep 2023 06:01:29 -0700 (PDT) X-Gm-Message-State: AOJu0YxNAQhsW9lduCTelGiWkL499ro98hUiwNti5qJ6ds3M1leNstjm yWERbgqEVLsOF2oLRioMOwScULdnfgYkdDp3qA== X-Received: by 2002:a05:6512:3e08:b0:500:77c4:108 with SMTP id i8-20020a0565123e0800b0050077c40108mr2444873lfv.9.1694610088278; Wed, 13 Sep 2023 06:01:28 -0700 (PDT) MIME-Version: 1.0 References: <20220615090517.3961621-1-windhl@126.com> In-Reply-To: <20220615090517.3961621-1-windhl@126.com> From: Rob Herring Date: Wed, 13 Sep 2023 08:01:15 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arch: arm: mach-versatile: Add missing of_node_put in integrator.c To: heliang Cc: linus.walleij@linaro.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 06:01:37 -0700 (PDT) X-Spam-Status: No, score=1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,SUSPICIOUS_RECIPS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Wed, Jun 15, 2022 at 4:06=E2=80=AFAM heliang wrote: > > In cm_init(), of_find_matching_node() will return a node pointer with > refcount incremented. We should use of_node_put() when the pointer is > not used anymore. > > Signed-off-by: heliang > --- > arch/arm/mach-versatile/integrator.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm/mach-versatile/integrator.c b/arch/arm/mach-versati= le/integrator.c > index fdf9c4db08a7..fba19357171a 100644 > --- a/arch/arm/mach-versatile/integrator.c > +++ b/arch/arm/mach-versatile/integrator.c > @@ -76,6 +76,7 @@ void cm_init(void) > return; > } > cm_base =3D of_iomap(cm, 0); > + of_node_put(cm); Not really sure this is right. It is in the sense that the DT node is never accessed again. However, the device itself is still accessed and I tend to think a ref to the DT node should be held for that lifetime which in this case is forever. Really, none of this matters because nodes are never removed and these fixes are kind of pointless. Note that cm_get() and cm_control() are never used and can be removed. That would be the more useful clean-up. Rob