Re: [PATCH] cacheinfo: Decrement refcount in cache_setup_of_node()

From: Sudeep Holla
Date: Thu Oct 27 2022 - 08:47:03 EST


On Wed, Oct 26, 2022 at 08:59:54PM +0200, Pierre Gondois wrote:
> Refcounts to DT nodes are only incremented in the function
> and never decremented. Decrease the refcounts when necessary.
>

Thanks for fixing this. I had observed this once before but I wasn't
sure on of_node_get usage in general. Since we assign and use
device_node pointers for comparison later, should be keep the reference
or drop it. I still don't know and keep getting such questions whenever
I touch anything around device_node reference. IIUC as long as we don't
use that you access the node itself, we are safe to drop the reference.

That said, this change looks good to me.

Reviewed-by: Sudeep Holla <sudeep.holla@xxxxxxx>

--
Regards,
Sudeep