diff --git a/net/core/dev.c b/net/core/dev.c index 7e885d069707..e82e9b82dfd9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9302,8 +9302,10 @@ int register_netdevice(struct net_device *dev) goto err_uninit; ret = netdev_register_kobject(dev); - if (ret) + if (ret) { + dev->reg_state = NETREG_UNREGISTERED; goto err_uninit; + } dev->reg_state = NETREG_REGISTERED; __netdev_update_features(dev);