[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <TY2PR01MB4812FA6549BA23233D9670CBD87B0@TY2PR01MB4812.jpnprd01.prod.outlook.com>
Date: Tue, 26 Feb 2019 08:54:21 +0000
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: Julia Lawall <julia.lawall@...6.fr>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kishon Vijay Abraham I <kishon@...com>,
"Sergei Shtylyov (sergei.shtylyov@...entembedded.com)"
<sergei.shtylyov@...entembedded.com>
Subject: RE: question about drivers/phy/renesas/phy-rcar-gen2.c
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
Powered by blists - more mailing lists