summaryrefslogtreecommitdiff
path: root/drivers/net/loopback.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-07-30 16:37:19 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-31 02:28:14 -0700
commitaeed9e82cd258b9699eaa6568efefba9cc6d5f01 (patch)
tree0a3cd08162e6c7b11a7fde452877571b48559620 /drivers/net/loopback.c
parent7f988eab57bd22884bbc452fb04c6c18738666b3 (diff)
downloadlinux-3.10-aeed9e82cd258b9699eaa6568efefba9cc6d5f01.tar.gz
linux-3.10-aeed9e82cd258b9699eaa6568efefba9cc6d5f01.tar.bz2
linux-3.10-aeed9e82cd258b9699eaa6568efefba9cc6d5f01.zip
[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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 6ba6ed2b480..5106c2328d1 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -229,7 +229,12 @@ struct net_device loopback_dev = {
/* Setup and register the loopback device. */
static int __init loopback_init(void)
{
- return register_netdev(&loopback_dev);
+ int err = register_netdev(&loopback_dev);
+
+ if (err)
+ panic("loopback: Failed to register netdevice: %d\n", err);
+
+ return err;
};
module_init(loopback_init);