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

I was wondering whether phy-rcar-gen2.c would use dynamically allocated
device nodes? 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-03 08:03    [W:0.069 / U:29.620 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site