mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "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 08:54:21 +0000	[thread overview]
Message-ID: <TY2PR01MB4812FA6549BA23233D9670CBD87B0@TY2PR01MB4812.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1902030759010.19281@hadrien>

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"?

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  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-03  7:02 Julia Lawall
2019-02-26  8:54 ` Yoshihiro Shimoda [this message]
2019-02-26  9:01   ` Julia Lawall
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=TY2PR01MB4812FA6549BA23233D9670CBD87B0@TY2PR01MB4812.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.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

all inboxes | Powered by JetHome®