diff options
-rw-r--r-- | net/ipv4/route.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 7864d0c48968..3888f6ba0a5c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -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); |