linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] opp: fix of_node leak for unsupported entries
Date: Wed, 8 Jan 2020 11:38:46 +0100	[thread overview]
Message-ID: <20200108103846.GA6894@qmqm.qmqm.pl> (raw)
In-Reply-To: <20200108073338.4z6gktglduigfo5p@vireshk-i7>

On Wed, Jan 08, 2020 at 01:03:38PM +0530, Viresh Kumar wrote:
> 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 ?

Indeed it is! This means that _opp_add_static_v2() is storing a pointer
to a node without taking a reference to it. Is there something else that
guarantees the node won't disappear later?

Best Regards,
Michał Mirosław

  reply	other threads:[~2020-01-08 10:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 19:36 [PATCH 1/2] opp: fix of_node leak for unsupported entries Michał Mirosław
2020-01-03 19:36 ` [PATCH 2/2] opp: quiet down WARN when no valid OPPs remain Michał Mirosław
2020-01-07  6:41   ` Viresh Kumar
2020-01-07  9:58     ` Michał Mirosław
2020-01-07 11:30       ` Viresh Kumar
2020-01-07 13:57         ` Michał Mirosław
2020-01-08  6:49           ` Viresh Kumar
2020-01-08  8:17   ` Viresh Kumar
2020-01-07  6:31 ` [PATCH 1/2] opp: fix of_node leak for unsupported entries Viresh Kumar
2020-01-07  6:36 ` Viresh Kumar
2020-01-07 14:04   ` Michał Mirosław
2020-01-08  7:33     ` Viresh Kumar
2020-01-08 10:38       ` Michał Mirosław [this message]
2020-01-08 10:44         ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200108103846.GA6894@qmqm.qmqm.pl \
    --to=mirq-linux@rere.qmqm.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).