aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/devinet.c5
-rw-r--r--net/ipv6/addrconf.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index abf6352f990f..5b77bdaa57dd 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1056,10 +1056,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
1056 if (!in_dev) { 1056 if (!in_dev) {
1057 if (event == NETDEV_REGISTER) { 1057 if (event == NETDEV_REGISTER) {
1058 in_dev = inetdev_init(dev); 1058 in_dev = inetdev_init(dev);
1059 if (!in_dev)
1060 return notifier_from_errno(-ENOMEM);
1059 if (dev == &loopback_dev) { 1061 if (dev == &loopback_dev) {
1060 if (!in_dev)
1061 panic("devinet: "
1062 "Failed to create loopback\n");
1063 IN_DEV_CONF_SET(in_dev, NOXFRM, 1); 1062 IN_DEV_CONF_SET(in_dev, NOXFRM, 1);
1064 IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); 1063 IN_DEV_CONF_SET(in_dev, NOPOLICY, 1);
1065 } 1064 }
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 06012920912a..91ef3be5abad 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2256,14 +2256,14 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2256 struct net_device *dev = (struct net_device *) data; 2256 struct net_device *dev = (struct net_device *) data;
2257 struct inet6_dev *idev = __in6_dev_get(dev); 2257 struct inet6_dev *idev = __in6_dev_get(dev);
2258 int run_pending = 0; 2258 int run_pending = 0;
2259 int err;
2259 2260
2260 switch(event) { 2261 switch(event) {
2261 case NETDEV_REGISTER: 2262 case NETDEV_REGISTER:
2262 if (!idev && dev->mtu >= IPV6_MIN_MTU) { 2263 if (!idev && dev->mtu >= IPV6_MIN_MTU) {
2263 idev = ipv6_add_dev(dev); 2264 idev = ipv6_add_dev(dev);
2264 if (!idev) 2265 if (!idev)
2265 printk(KERN_WARNING "IPv6: add_dev failed for %s\n", 2266 return notifier_from_errno(-ENOMEM);
2266 dev->name);
2267 } 2267 }
2268 break; 2268 break;
2269 case NETDEV_UP: 2269 case NETDEV_UP:
@@ -2373,7 +2373,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2373 NULL); 2373 NULL);
2374 addrconf_sysctl_register(idev, &idev->cnf); 2374 addrconf_sysctl_register(idev, &idev->cnf);
2375#endif 2375#endif
2376 snmp6_register_dev(idev); 2376 err = snmp6_register_dev(idev);
2377 if (err)
2378 return notifier_from_errno(err);
2377 } 2379 }
2378 break; 2380 break;
2379 } 2381 }