radix-tree tests: properly initialize mutex
authorRoss Zwisler <[email protected]>
Tue, 11 Oct 2016 20:51:24 +0000 (13:51 -0700)
committerLinus Torvalds <[email protected]>
Tue, 11 Oct 2016 22:06:30 +0000 (15:06 -0700)
The pthread_mutex_t in regression1.c wasn't being initialized properly.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ross Zwisler <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Shuah Khan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
tools/testing/radix-tree/regression1.c

index 2d03a63bb79c6777c144296fb18e4e4ebcbd6ab3..0d6813a61b37f904b436e74448c910a350c10bb3 100644 (file)
@@ -43,7 +43,7 @@
 #include "regression.h"
 
 static RADIX_TREE(mt_tree, GFP_KERNEL);
-static pthread_mutex_t mt_lock;
+static pthread_mutex_t mt_lock = PTHREAD_MUTEX_INITIALIZER;
 
 struct page {
        pthread_mutex_t lock;