1
0
Fork 0

tools/liblockdep: Fix comparison of a boolean value with a value of 2

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>
hifive-unleashed-5.1
zhangdianfang 2014-05-30 08:37:28 +08:00 committed by Sasha Levin
parent 7171511eae
commit 6c642e442e
1 changed files with 1 additions and 1 deletions

View 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();
}