From 7a82d3056973b2306b91fc2798f2d412f70aa19d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 13 Jun 2015 16:59:49 -0700 Subject: netdev: Initialize at the beginning of netdev_unregister_provider(). 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 Acked-by: Alex Wang --- lib/netdev.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/netdev.c') diff --git a/lib/netdev.c b/lib/netdev.c index 03a754979..be82249b5 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) { -- cgit v1.2.1