aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-15 15:55:33 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-15 15:55:33 -0400
commit9d6dda32c7570bbf189cf74fbc36338d0a94e999 (patch)
treeeac71d1bf5f7c07ebf4360fd9cd48d79cab402fd /drivers
parent4ae289444b968b4cefd776ada8da519ce10e56fa (diff)
[NETNS]: Don't panic on creating the namespace's loopback
When the loopback device is failed to initialize inside the new namespaces, panic() is called. Do not do it when the namespace in question is not the init_net. Plus cleanup the error path a bit. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/loopback.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index be25aa33971c..662b8d16803c 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -265,17 +265,16 @@ static __net_init int loopback_net_init(struct net *net)
265 if (err) 265 if (err)
266 goto out_free_netdev; 266 goto out_free_netdev;
267 267
268 err = 0;
269 net->loopback_dev = dev; 268 net->loopback_dev = dev;
269 return 0;
270 270
271out:
272 if (err)
273 panic("loopback: Failed to register netdevice: %d\n", err);
274 return err;
275 271
276out_free_netdev: 272out_free_netdev:
277 free_netdev(dev); 273 free_netdev(dev);
278 goto out; 274out:
275 if (net == &init_net)
276 panic("loopback: Failed to register netdevice: %d\n", err);
277 return err;
279} 278}
280 279
281static __net_exit void loopback_net_exit(struct net *net) 280static __net_exit void loopback_net_exit(struct net *net)