tools/liblockdep: Fix comparison of a boolean value with a value of 2
authorzhangdianfang <zhangdianfang@huawei.com>
Fri, 30 May 2014 00:37:28 +0000 (08:37 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 7 Jul 2014 16:02:21 +0000 (12:02 -0400)
Comparison of a boolean value (!__init_state) with a value of 2 (done)
as currently happens in the code is unlikely to succeed and causes
repeated initialization of the pthread function pointers.

Instead, remove boolean comparison so that we would initialize said
function pointers only once.

Ref: https://bugzilla.kernel.org/show_bug.cgi?id=76741
Cc: Jean Delvare <jdelvare@suse.de>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Dianfang Zhang <zhangdianfang@huawei.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
tools/lib/lockdep/preload.c

index 23bd69cb5ade7014e8630e87ad89a16e2d95be71..b5e52af6ddf37aecbac7b2bdd42b156504635755 100644 (file)
@@ -92,7 +92,7 @@ enum { none, prepare, done, } __init_state;
 static void init_preload(void);
 static void try_init_preload(void)
 {
-       if (!__init_state != done)
+       if (__init_state != done)
                init_preload();
 }