aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-06-05 02:34:08 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-06-07 16:39:03 -0400
commit8d76527e728d00d1cf9d5dd663caffb2dcf05ae6 (patch)
treee3cae9cff087f2330a64a8ee7bff36c312d9471b
parentf0e48dbfc5c74e967fea4c0fd0c5ad07557ae0c8 (diff)
[IPV4]: Only panic if inetdev_init fails for loopback
When I made the inetdev_init call work on all devices I incorrectly left in the panic call as well. It is obviously undesirable to panic on an allocation failure for a normal network device. This patch moves the panic call under the loopback if clause. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/devinet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 7f95e6e9beeb..88a22d20bf73 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1057,9 +1057,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
1057 if (!in_dev) { 1057 if (!in_dev) {
1058 if (event == NETDEV_REGISTER) { 1058 if (event == NETDEV_REGISTER) {
1059 in_dev = inetdev_init(dev); 1059 in_dev = inetdev_init(dev);
1060 if (!in_dev)
1061 panic("devinet: Failed to create loopback\n");
1062 if (dev == &loopback_dev) { 1060 if (dev == &loopback_dev) {
1061 if (!in_dev)
1062 panic("devinet: "
1063 "Failed to create loopback\n");
1063 in_dev->cnf.no_xfrm = 1; 1064 in_dev->cnf.no_xfrm = 1;
1064 in_dev->cnf.no_policy = 1; 1065 in_dev->cnf.no_policy = 1;
1065 } 1066 }