netdev: Initialize at the beginning of netdev_unregister_provider().
authorBen Pfaff <blp@nicira.com>
Sat, 13 Jun 2015 23:59:49 +0000 (16:59 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 16 Jun 2015 15:21:33 +0000 (08:21 -0700)
commit7a82d3056973b2306b91fc2798f2d412f70aa19d
tree779d5239d39fae42e82c9cd979ee3eccf9fa03cb
parentc4ea752900e12053ca65d0868d47901d251b29eb
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>
lib/netdev.c