From: Simon Wunderlich sw@simonwunderlich.de Date: Thu, 27 Jun 2019 12:39:34 +0200
- in_dev = in_dev_get(dev);
- if (!in_dev)
return 0;
Move this below the rcu_read_lock() and use __in_dev_get_rcu() instead.
And then...
- rcu_read_lock();
...
- rcu_read_unlock();
- in_dev_put(in_dev);
You can drop this in_dev_put() as well.
- in6_dev = in6_dev_get(dev);
- if (!in6_dev)
return 0;
- read_lock_bh(&in6_dev->lock);
Similarly here you can use __in6_dev_get().