Skip to content

Commit

Permalink
tools/liblockdep: Fix comparison of a boolean value with a value of 2
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhangdianfang authored and Sasha Levin committed Jul 7, 2014
1 parent 7171511 commit 6c642e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/lockdep/preload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 6c642e4

Please sign in to comment.