Commit "fib: RCU conversion of fib_lookup()" removed rcu_read_lock() from
__mkroute_output but left a couple of calls to rcu_read_unlock() in there.
This causes lockdep to complain that the rcu_read_unlock() call in
__ip_route_output_key causes a lock inbalance and quickly crashes the
kernel. The below fixes this for me.
Signed-off-by: Dimitris Michailidis <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
rth = dst_alloc(&ipv4_dst_ops);
- if (!rth) {
- rcu_read_unlock();
+ if (!rth)
return -ENOBUFS;
- }
+
in_dev_hold(in_dev);
- rcu_read_unlock();
rth->idev = in_dev;
atomic_set(&rth->dst.__refcnt, 1);