[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <m13b601917.fsf@ebiederm.dsl.xmission.com>
Date: Wed, 24 Jan 2007 13:09:40 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: <netdev@...r.kernel.org>
Cc: Steven Whitehouse <steve@...gwyn.com>, davem@...emloft.net
Subject: [PATCH] decnet: handle a failure in neigh_parms_alloc
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: Eric W. Biederman <ebiederm@...ssion.com>
---
net/decnet/dn_dev.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 324eb47..f6a2b2a 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1149,6 +1149,11 @@ struct dn_dev *dn_dev_create(struct net_device *dev, int *err)
}
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;
+ }
dn_dev_sysctl_register(dev, &dn_db->parms);
--
1.4.4.1.g278f
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists