提交 aeed9e82 编写于 作者: H Herbert Xu 提交者: David S. Miller

[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: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7f988eab
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册