From: Herbert Xu Date: Mon, 30 Jul 2007 23:37:19 +0000 (-0700) Subject: [NET] loopback: Panic if registration fails X-Git-Tag: v2.6.23-rc2~35^2~24 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeed9e82cd258b9699eaa6568efefba9cc6d5f01;p=linux-2.6 [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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 6ba6ed2b48..5106c2328d 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);