diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-07-30 19:37:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-31 05:28:14 -0400 |
commit | aeed9e82cd258b9699eaa6568efefba9cc6d5f01 (patch) | |
tree | 0a3cd08162e6c7b11a7fde452877571b48559620 /drivers/net/loopback.c | |
parent | 7f988eab57bd22884bbc452fb04c6c18738666b3 (diff) |
[NET] loopback: Panic if registration fails
Because IPv4 and IPv6 both depend on the presence of the loopback
device to function, failure in registration the loopback device should
be fatal.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r-- | drivers/net/loopback.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 6ba6ed2b480a..5106c2328d12 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -229,7 +229,12 @@ struct net_device loopback_dev = { | |||
229 | /* Setup and register the loopback device. */ | 229 | /* Setup and register the loopback device. */ |
230 | static int __init loopback_init(void) | 230 | static int __init loopback_init(void) |
231 | { | 231 | { |
232 | return register_netdev(&loopback_dev); | 232 | int err = register_netdev(&loopback_dev); |
233 | |||
234 | if (err) | ||
235 | panic("loopback: Failed to register netdevice: %d\n", err); | ||
236 | |||
237 | return err; | ||
233 | }; | 238 | }; |
234 | 239 | ||
235 | module_init(loopback_init); | 240 | module_init(loopback_init); |