Re: [PATCH 1/2] opp: fix of_node leak for unsupported entries

From: Viresh Kumar
Date: Wed Jan 08 2020 - 02:33:48 EST


On 07-01-20, 15:04, MichaÅ MirosÅaw wrote:
> On Tue, Jan 07, 2020 at 12:06:16PM +0530, Viresh Kumar wrote:
> > Discard my earlier reply, it wasn't accurate/correct.
> >
> > On 03-01-20, 20:36, MichaÅ MirosÅaw wrote:
> > > When parsing OPP v2 table, unsupported entries return NULL from
> > > _opp_add_static_v2().
> >
> > Right, as we don't want parsing to fail here.
> >
> > > In this case node reference is leaked.
> >
> > Why do you think so ?
>
> for_each_available_child_of_node() returns nodes with refcount
> increased

I believe it also drops the refcount of the previous node everytime the loop
goes to the next element. Else we would be required do that from within that
loop itself, isn't it ?

--
viresh