lacp: Really fix mutex initialization.
authorBen Pfaff <blp@nicira.com>
Wed, 7 May 2014 20:14:45 +0000 (13:14 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 7 May 2014 20:17:35 +0000 (13:17 -0700)
commit2339e869b0bed2202d9632eac82368be27ff041a
tree6fc6c3772ff55bbc5c5bd0e1aa6fc2d67eb41350
parent8031655731348ce72117ef34af27cb6f64cb39b2
lacp: Really fix mutex initialization.

Commit 2a3fb0aa3c (lacp: Don't lock potentially uninitialized mutex in
lacp_status().) fixed one bug related to acquiring the file scope 'mutex'
without initializing it.  However, there was at least one other, in
lacp_unixctl_show().  One could just fix that one problem, but that leaves
the possibility that I might have missed one or two more.  This commit
fixes the problem for good, by adding a helper that initializes the mutex
and then acquires it.

It's not entirely clear why 'mutex' is a recursive mutex.  I think that it
might be just because of the callback in lacp_run().  An alternate fix,
therefore, would be to eliminate the callback and therefore the need for
runtime initialization of the mutex.

Bug #1245659.
Reported-by: Jeffrey Merrick <jmerrick@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/lacp.c