Commit 8d76527e authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0e48dbf
...@@ -1057,9 +1057,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, ...@@ -1057,9 +1057,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
if (!in_dev) { if (!in_dev) {
if (event == NETDEV_REGISTER) { if (event == NETDEV_REGISTER) {
in_dev = inetdev_init(dev); in_dev = inetdev_init(dev);
if (!in_dev)
panic("devinet: Failed to create loopback\n");
if (dev == &loopback_dev) { if (dev == &loopback_dev) {
if (!in_dev)
panic("devinet: "
"Failed to create loopback\n");
in_dev->cnf.no_xfrm = 1; in_dev->cnf.no_xfrm = 1;
in_dev->cnf.no_policy = 1; in_dev->cnf.no_policy = 1;
} }
......
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