diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-05-21 18:10:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-21 18:10:31 -0400 |
commit | ca0f31125c5cf0d48f47c2e1a3785a08876a7e87 (patch) | |
tree | 8480e770af9b7c2f85e94327db7259c7d86ccf4b /net/core | |
parent | 1f7a2bb4eff75c56a71b3896c36a34e787c5e4e5 (diff) |
netns: simplify net_ns_init
The net_ns_init code can be simplified. No need to save error code
if it is only going to panic if it is set 4 lines later.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/net_namespace.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 69d7549db9a..b7292a2719d 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -196,7 +196,6 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net) | |||
196 | static int __init net_ns_init(void) | 196 | static int __init net_ns_init(void) |
197 | { | 197 | { |
198 | struct net_generic *ng; | 198 | struct net_generic *ng; |
199 | int err; | ||
200 | 199 | ||
201 | #ifdef CONFIG_NET_NS | 200 | #ifdef CONFIG_NET_NS |
202 | net_cachep = kmem_cache_create("net_namespace", sizeof(struct net), | 201 | net_cachep = kmem_cache_create("net_namespace", sizeof(struct net), |
@@ -216,15 +215,14 @@ static int __init net_ns_init(void) | |||
216 | rcu_assign_pointer(init_net.gen, ng); | 215 | rcu_assign_pointer(init_net.gen, ng); |
217 | 216 | ||
218 | mutex_lock(&net_mutex); | 217 | mutex_lock(&net_mutex); |
219 | err = setup_net(&init_net); | 218 | if (setup_net(&init_net)) |
219 | panic("Could not setup the initial network namespace"); | ||
220 | 220 | ||
221 | rtnl_lock(); | 221 | rtnl_lock(); |
222 | list_add_tail(&init_net.list, &net_namespace_list); | 222 | list_add_tail(&init_net.list, &net_namespace_list); |
223 | rtnl_unlock(); | 223 | rtnl_unlock(); |
224 | 224 | ||
225 | mutex_unlock(&net_mutex); | 225 | mutex_unlock(&net_mutex); |
226 | if (err) | ||
227 | panic("Could not setup the initial network namespace"); | ||
228 | 226 | ||
229 | return 0; | 227 | return 0; |
230 | } | 228 | } |