em_meta: avoid one dev_put()

Another rcu conversion to avoid one dev_hold()/dev_put() pair

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2009-11-04 05:23:31 -08:00 committed by David S. Miller
parent c7079857cd
commit d0075634cf

View File

@ -309,10 +309,10 @@ META_COLLECTOR(var_sk_bound_if)
} else { } else {
struct net_device *dev; struct net_device *dev;
dev = dev_get_by_index(&init_net, skb->sk->sk_bound_dev_if); rcu_read_lock();
dev = dev_get_by_index_rcu(&init_net, skb->sk->sk_bound_dev_if);
*err = var_dev(dev, dst); *err = var_dev(dev, dst);
if (dev) rcu_read_unlock();
dev_put(dev);
} }
} }