summaryrefslogtreecommitdiff
path: root/lib/netdev.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-06-13 16:59:49 -0700
committerBen Pfaff <blp@nicira.com>2015-06-16 08:21:33 -0700
commit7a82d3056973b2306b91fc2798f2d412f70aa19d (patch)
tree779d5239d39fae42e82c9cd979ee3eccf9fa03cb /lib/netdev.c
parentc4ea752900e12053ca65d0868d47901d251b29eb (diff)
downloadopenvswitch-7a82d3056973b2306b91fc2798f2d412f70aa19d.tar.gz
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 <blp@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
Diffstat (limited to 'lib/netdev.c')
-rw-r--r--lib/netdev.c2
1 files changed, 2 insertions, 0 deletions
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) {