linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	"Sergei Shtylyov (sergei.shtylyov@cogentembedded.com)" 
	<sergei.shtylyov@cogentembedded.com>
Subject: RE: question about drivers/phy/renesas/phy-rcar-gen2.c
Date: Tue, 26 Feb 2019 10:01:04 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.20.1902261000420.3499@hadrien> (raw)
In-Reply-To: <TY2PR01MB4812FA6549BA23233D9670CBD87B0@TY2PR01MB4812.jpnprd01.prod.outlook.com>



On Tue, 26 Feb 2019, Yoshihiro Shimoda wrote:

> Hello,
> (Sergei made this code, so I added his email as CC)
>
> I'm sorry for the delayed response.
>
> > From: Julia Lawall, Sent: Sunday, February 3, 2019 4:03 PM
> >
> > Hello,
> >
> > I was wondering whether phy-rcar-gen2.c would use dynamically allocated
> > device nodes?
>
> I'm sorry, but what is "dynamically allocated device nodes"?

Device nodes for which there will be a meor leak if one doesn't put
of_node_put.

julia

>
> Best regards,
> Yoshihiro Shimoda
>
> >  If so, it looks like the following code could cause a
> > use-after-free, due to not incrementing th reference count:
> >
> > 	for_each_child_of_node(dev->of_node, np) {
> > 		struct rcar_gen2_channel *channel = drv->channels + i;
> > 		u32 channel_num;
> > 		int error, n;
> >
> > 		channel->of_node = np;
> > 		...
> > 	}
> >
> > On the other hand, if the reference cound it incrememnted, preventing
> > memory leaks in the case where the probe function fails would entail some
> > complex rewriting of the code, so I thought it would be better to ask
> > first.
> >
> > thanks,
> > julia
>

  reply	other threads:[~2019-02-26  9:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-03  7:02 question about drivers/phy/renesas/phy-rcar-gen2.c Julia Lawall
2019-02-26  8:54 ` Yoshihiro Shimoda
2019-02-26  9:01   ` Julia Lawall [this message]
2019-02-27  1:06     ` Yoshihiro Shimoda
2019-02-27  6:08       ` Julia Lawall

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=alpine.DEB.2.20.1902261000420.3499@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=yoshihiro.shimoda.uh@renesas.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;
as well as URLs for NNTP newsgroup(s).