Skip to content

Commit

Permalink
ipv4: Remove leftover rcu_read_unlock calls from __mkroute_output()
Browse files Browse the repository at this point in the history
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 <dm@chelsio.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dimitris Michailidis authored and David S. Miller committed Oct 8, 2010
1 parent 993284d commit 8391d07
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2396,12 +2396,10 @@ static int __mkroute_output(struct rtable **result,


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);
Expand Down

0 comments on commit 8391d07

Please sign in to comment.