[ovs-dev] [PATCH ovn 07/11] netdev: Initialize at the beginning of netdev_unregister_provider().

Alex Wang alexw at nicira.com
Mon Jun 15 17:49:15 UTC 2015


Acked-by: Alex Wang <alexw at nicira.com>

On Sun, Jun 14, 2015 at 12:19 PM, Ben Pfaff <blp at nicira.com> wrote:

> Otherwise, if netdev_unregister_provider() is called before any other
> netdev function, netdev_class_mutex is not initialized and the attempt to
> lock it aborts.
>
> This doesn't fix an existing bug but with the following commit
> --enable-dummy=system will make netdev_unregister_provider() the first
> netdev function to be called.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/netdev.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lib/netdev.c b/lib/netdev.c
> index 03a7549..be82249 100644
> --- a/lib/netdev.c
> +++ b/lib/netdev.c
> @@ -257,6 +257,8 @@ netdev_unregister_provider(const char *type)
>      struct netdev_registered_class *rc;
>      int error;
>
> +    netdev_initialize();
> +
>      ovs_mutex_lock(&netdev_class_mutex);
>      rc = netdev_lookup_class(type);
>      if (!rc) {
> --
> 2.1.3
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list