lkml.org 
[lkml]   [2020]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] opp: fix of_node leak for unsupported entries
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, and _opp_add_static_v2() returning NULL does not store the
pointer anywhere - the created (temporary) OPP structure is freed,
but _opp_free() does not release node at opp->np.

I guess maybe the _opp_free() should be fixed instead?

Best Regards,
Michał Mirosław

\
 
 \ /
  Last update: 2020-01-07 15:05    [W:0.099 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site