From: Jakub Kicinski <kuba@kernel.org>
To: Zhang Zekun <zhangzekun11@huawei.com>
Cc: <justin.chen@broadcom.com>, <florian.fainelli@broadcom.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<o.rempel@pengutronix.de>, <kory.maincent@bootlin.com>,
<horms@kernel.org>, <edumazet@google.com>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <chenjun102@huawei.com>
Subject: Re: [PATCH net 0/2] Get the device_node before calling of_find_node_by_name()
Date: Wed, 30 Oct 2024 18:17:09 -0700 [thread overview]
Message-ID: <20241030181709.24ae5efb@kernel.org> (raw)
In-Reply-To: <20241024015909.58654-1-zhangzekun11@huawei.com>
On Thu, 24 Oct 2024 09:59:07 +0800 Zhang Zekun wrote:
> of_find_node_by_name() will decrease the refount of the device node.
> Get the device_node before call to it.
Doing some quick grepping I think Andrew is completely right.
Most callers either get this wrong or call get() immediately prior.
Maybe add a new helper with more suitable semantics?
The goal is not to fix the bugs but to prevent them in the first place.
--
pw-bot: cr
prev parent reply other threads:[~2024-10-31 1:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 1:59 [PATCH net 0/2] Get the device_node before calling of_find_node_by_name() Zhang Zekun
2024-10-24 1:59 ` [PATCH net 1/2] net: bcmasp: Add missing of_node_get() before of_find_node_by_name() Zhang Zekun
2024-10-24 11:56 ` Andrew Lunn
2024-10-25 2:41 ` zhangzekun (A)
2024-10-25 13:14 ` Andrew Lunn
2024-11-01 9:31 ` zhangzekun (A)
2024-11-01 13:03 ` Andrew Lunn
2024-10-24 1:59 ` [PATCH net 2/2] net: pse-pd: " Zhang Zekun
2024-10-24 7:25 ` Oleksij Rempel
2024-10-24 7:45 ` Kory Maincent
2024-10-31 1:17 ` Jakub Kicinski [this message]
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=20241030181709.24ae5efb@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=chenjun102@huawei.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=horms@kernel.org \
--cc=justin.chen@broadcom.com \
--cc=kory.maincent@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=zhangzekun11@huawei.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;
as well as URLs for NNTP newsgroup(s).