提交 01b7806c 编写于 作者: R Roy.Li 提交者: David S. Miller

ipv6: remove a rcu_read_lock in ndisc_constructor

in6_dev_get(dev) takes a reference on struct inet6_dev, we dont need
rcu locking in ndisc_constructor()
Signed-off-by: NRoy.Li <rongqing.li@windriver.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f861c2b8
...@@ -370,17 +370,14 @@ static int ndisc_constructor(struct neighbour *neigh) ...@@ -370,17 +370,14 @@ static int ndisc_constructor(struct neighbour *neigh)
struct neigh_parms *parms; struct neigh_parms *parms;
int is_multicast = ipv6_addr_is_multicast(addr); int is_multicast = ipv6_addr_is_multicast(addr);
rcu_read_lock();
in6_dev = in6_dev_get(dev); in6_dev = in6_dev_get(dev);
if (in6_dev == NULL) { if (in6_dev == NULL) {
rcu_read_unlock();
return -EINVAL; return -EINVAL;
} }
parms = in6_dev->nd_parms; parms = in6_dev->nd_parms;
__neigh_parms_put(neigh->parms); __neigh_parms_put(neigh->parms);
neigh->parms = neigh_parms_clone(parms); neigh->parms = neigh_parms_clone(parms);
rcu_read_unlock();
neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST; neigh->type = is_multicast ? RTN_MULTICAST : RTN_UNICAST;
if (!dev->header_ops) { if (!dev->header_ops) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册