[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuQAufXBEp-87mrv@bogus>
Date: Fri, 13 Sep 2024 10:07:05 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Miquel Sabaté Solà <mikisabate@...il.com>
Cc: paul.walmsley@...ive.com, palmer@...belt.com, aou@...s.berkeley.edu,
cuiyunhui@...edance.com, jeremy.linton@....com,
sunilvl@...tanamicro.com, linux-riscv@...ts.infradead.org,
Sudeep Holla <sudeep.holla@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: Prevent a bad reference count on CPU nodes
On Fri, Sep 13, 2024 at 10:00:52AM +0200, Miquel Sabaté Solà wrote:
> When populating cache leaves we previously fetched the CPU device node
> at the very beginning. But when ACPI is enabled we go through a
> specific branch which returns early and does not call 'of_node_put' for
> the node that was acquired.
>
> Since we are not using a CPU device node for the ACPI code anyways, we
> can simply move the initialization of it just passed the ACPI block, and
> we are guaranteed to have an 'of_node_put' call for the acquired node.
> This prevents a bad reference count of the CPU device node.
>
> Moreover, the previous function did not check for errors when acquiring
> the device node, so a return -ENOENT has been added for that case.
>
LGTM,
Reviewed-by: Sudeep Holla <sudeep.holla@....com>
> Signed-off-by: Miquel Sabaté Solà <mikisabate@...il.com>
> ---
> I was wondering if this should also be sent to stable, but I have not seen
> a report on it, and this is not responsible for an oops or anything like that.
> So in the end I decided not to, but maybe you consider otherwise.
>
Right, it is not a fix per say and hence not a stable material as ACPI
is not accessing the node pointer.
--
Regards,
Sudeep
Powered by blists - more mailing lists