From: madhuparnabhowmik04@gmail.com
To: davem@davemloft.net, gregkh@linuxfoundation.org
Cc: paulmck@kernel.org, joel@joelfernandes.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
rcu@vger.kernel.org, frextrite@gmail.com,
Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
Subject: [PATCH] net: wan: lapbether.c: Use built-in RCU list checking
Date: Wed, 15 Jan 2020 17:11:01 +0530 [thread overview]
Message-ID: <20200115114101.13068-1-madhuparnabhowmik04@gmail.com> (raw)
From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
The only callers of the function lapbeth_get_x25_dev()
are lapbeth_rcv() and lapbeth_device_event().
lapbeth_rcv() uses rcu_read_lock() whereas lapbeth_device_event()
is called with RTNL held (As mentioned in the comments).
Therefore, pass lockdep_rtnl_is_held() as cond argument in
list_for_each_entry_rcu();
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
---
drivers/net/wan/lapbether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 0f1217b506ad..e30d91a38cfb 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -64,7 +64,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev)
{
struct lapbethdev *lapbeth;
- list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) {
+ list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) {
if (lapbeth->ethdev == dev)
return lapbeth;
}
--
2.17.1
next reply other threads:[~2020-01-15 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 11:41 madhuparnabhowmik04 [this message]
2020-01-16 13:31 ` [PATCH] net: wan: lapbether.c: Use built-in RCU list checking David Miller
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=20200115114101.13068-1-madhuparnabhowmik04@gmail.com \
--to=madhuparnabhowmik04@gmail.com \
--cc=davem@davemloft.net \
--cc=frextrite@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
/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).