From: Julia Lawall <julia.lawall@lip6.fr>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
linux-kernel@vger.kernel.org
Subject: question about drivers/phy/renesas/phy-rcar-gen2.c
Date: Sun, 3 Feb 2019 08:02:46 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.21.1902030759010.19281@hadrien> (raw)
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
next reply other threads:[~2019-02-03 7:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-03 7:02 Julia Lawall [this message]
2019-02-26 8:54 ` Yoshihiro Shimoda
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=alpine.DEB.2.21.1902030759010.19281@hadrien \
--to=julia.lawall@lip6.fr \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®