Commit 50d7d7e3 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Chris Wright

[PATCH] DECNET: Handle a failure in neigh_parms_alloc (take 2)

While enhancing the neighbour code to handle multiple network
namespaces I noticed that decnet is assuming neigh_parms_alloc
will allways succeed, which is clearly wrong.  So handle the
failure.
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarSteven Whitehouse <steve@chygwyn.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent 75cd5141
...@@ -1116,16 +1116,23 @@ struct dn_dev *dn_dev_create(struct net_device *dev, int *err) ...@@ -1116,16 +1116,23 @@ struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
init_timer(&dn_db->timer); init_timer(&dn_db->timer);
dn_db->uptime = jiffies; dn_db->uptime = jiffies;
dn_db->neigh_parms = neigh_parms_alloc(dev, &dn_neigh_table);
if (!dn_db->neigh_parms) {
dev->dn_ptr = NULL;
kfree(dn_db);
return NULL;
}
if (dn_db->parms.up) { if (dn_db->parms.up) {
if (dn_db->parms.up(dev) < 0) { if (dn_db->parms.up(dev) < 0) {
neigh_parms_release(&dn_neigh_table, dn_db->neigh_parms);
dev->dn_ptr = NULL; dev->dn_ptr = NULL;
kfree(dn_db); kfree(dn_db);
return NULL; return NULL;
} }
} }
dn_db->neigh_parms = neigh_parms_alloc(dev, &dn_neigh_table);
dn_dev_sysctl_register(dev, &dn_db->parms); dn_dev_sysctl_register(dev, &dn_db->parms);
dn_dev_set_timer(dev); dn_dev_set_timer(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment