Skip to content

Commit

Permalink
[NET] loopback: Panic if registration fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jul 31, 2007
1 parent 7f988ea commit aeed9e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aeed9e8

Please sign in to comment.