Commit 93ad0f96 authored by Madhuparna Bhowmik's avatar Madhuparna Bhowmik Committed by David S. Miller

net: wan: lapbether.c: Use built-in RCU list checking

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: default avatarMadhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd5874da
...@@ -64,7 +64,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev) ...@@ -64,7 +64,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev)
{ {
struct lapbethdev *lapbeth; 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) if (lapbeth->ethdev == dev)
return lapbeth; return lapbeth;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment