neigh: no need to call lookup_neigh_parms in neigh_parms_alloc
authorGao feng <gaofeng@cn.fujitsu.com>
Thu, 20 Jun 2013 02:01:32 +0000 (10:01 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Jun 2013 04:13:24 +0000 (21:13 -0700)
neigh_table.parms always exist and is initialized,kmemdup
can use it to create new neigh_parms, actually lookup_neigh_parms
here will return neigh_table.parms too.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c

index decaa4b9db2fbd18536ee398aa65417113c35d2f..53eab513955a4bbaa29d2a63f3ba37288693e356 100644 (file)
@@ -1429,15 +1429,11 @@ static inline struct neigh_parms *lookup_neigh_parms(struct neigh_table *tbl,
 struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
                                      struct neigh_table *tbl)
 {
-       struct neigh_parms *p, *ref;
+       struct neigh_parms *p;
        struct net *net = dev_net(dev);
        const struct net_device_ops *ops = dev->netdev_ops;
 
-       ref = lookup_neigh_parms(tbl, net, 0);
-       if (!ref)
-               return NULL;
-
-       p = kmemdup(ref, sizeof(*p), GFP_KERNEL);
+       p = kmemdup(&tbl->parms, sizeof(*p), GFP_KERNEL);
        if (p) {
                p->tbl            = tbl;
                atomic_set(&p->refcnt, 1);