Skip to content

Commit

Permalink
netdev: Initialize at the beginning of netdev_unregister_provider().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
blp committed Jun 16, 2015
1 parent c4ea752 commit 7a82d30
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/netdev.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 7a82d30

Please sign in to comment.