From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
Yangtao Li <tiny.windzz@gmail.com>
Cc: lorenzo.pieralisi@arm.com, linux-pm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] cpuidle: big.LITTLE: fix refcount leak
Date: Mon, 17 Dec 2018 12:42:59 +0100 [thread overview]
Message-ID: <5791255.IEhMFO6dfL@aspire.rjw.lan> (raw)
In-Reply-To: <ee49b2fc-f855-4406-8780-0638d5fe09a0@linaro.org>
On Monday, December 10, 2018 6:00:12 PM CET Daniel Lezcano wrote:
> On 10/12/2018 17:26, Yangtao Li wrote:
> > of_find_node_by_path() acquires a reference to the node
> > returned by it and that reference needs to be dropped by its caller.
> > bl_idle_init() doesn't do that, so fix it.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>
> > ---
> > changes in v4:
> > -update tile
> > -refactor code,suggested by Daniel
> > ---
> > drivers/cpuidle/cpuidle-big_little.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c
> > index db2ede565f1a..b44476a1b7ad 100644
> > --- a/drivers/cpuidle/cpuidle-big_little.c
> > +++ b/drivers/cpuidle/cpuidle-big_little.c
> > @@ -167,6 +167,7 @@ static int __init bl_idle_init(void)
> > {
> > int ret;
> > struct device_node *root = of_find_node_by_path("/");
> > + const struct of_device_id *match_id;
> >
> > if (!root)
> > return -ENODEV;
> > @@ -174,7 +175,11 @@ static int __init bl_idle_init(void)
> > /*
> > * Initialize the driver just for a compliant set of machines
> > */
> > - if (!of_match_node(compatible_machine_match, root))
> > + match_id = of_match_node(compatible_machine_match, root);
> > +
> > + of_node_put(root);
> > +
> > + if (!match_id)
> > return -ENODEV;
> >
> > if (!mcpm_is_available())
> >
>
>
>
Patch applied, thanks!
prev parent reply other threads:[~2018-12-17 11:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 16:26 [PATCH v4] cpuidle: big.LITTLE: fix refcount leak Yangtao Li
2018-12-10 17:00 ` Daniel Lezcano
2018-12-17 11:42 ` Rafael J. Wysocki [this message]
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=5791255.IEhMFO6dfL@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=tiny.windzz@gmail.com \
/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