lkml.org 
[lkml]   [2019]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: question about drivers/phy/renesas/phy-rcar-gen2.c


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
>

\
 
 \ /
  Last update: 2019-02-26 10:02    [W:0.070 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site