[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_Jsq+609wEjMLsiLAMjSfAcMc-ashF9+f0rhbZRhM2FVPhmA@mail.gmail.com>
Date: Wed, 13 Sep 2023 08:01:15 -0500
From: Rob Herring <robh@...nel.org>
To: heliang <windhl@....com>
Cc: linus.walleij@...aro.org, linux@...linux.org.uk,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arch: arm: mach-versatile: Add missing of_node_put in integrator.c
On Wed, Jun 15, 2022 at 4:06 AM heliang <windhl@....com> 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 <windhl@....com>
> ---
> 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-versatile/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 = 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
Powered by blists - more mailing lists