Subject: Re: [PATCH net-next v2 03/22] ovpn: add basic netlink support

From: Esben Haabendal <[email-masked]>
Date: Tue, 26 Mar 2024 12:43:18 +0100

Antonio Quartulli <[email-masked]> writes:

> diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c
> index 25964eb89aac..3769f99cfe6f 100644
> --- a/drivers/net/ovpn/main.c
> +++ b/drivers/net/ovpn/main.c
> @@ -101,12 +104,23 @@ static int __init ovpn_init(void)
>  		return err;
>  	}
>  
> +	err = ovpn_nl_register();
> +	if (err) {
> +		pr_err("ovpn: can't register netlink family: %d\n", err);
> +		goto unreg_netdev;
> +	}
> +
>  	return 0;
> +
> +unreg_netdev:
> +	unregister_netdevice_notifier(&ovpn_netdev_notifier);
> +	return err;
>  }
>  
>  static __exit void ovpn_cleanup(void)
>  {
>  	unregister_netdevice_notifier(&ovpn_netdev_notifier);
> +	ovpn_nl_unregister();

Any good reason for not using reverse order from ovpn_init() here?

>  }

/Esben