From: Andrew Morton find_first_bit(addr, len) returns `len' on no match (it's not well commented). Cc: Kylie Hall Signed-off-by: Andrew Morton --- drivers/char/tpm/tpm.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix-fix-fix-fix drivers/char/tpm/tpm.c --- devel/drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix-fix-fix-fix 2006-04-14 23:42:06.000000000 -0700 +++ devel-akpm/drivers/char/tpm/tpm.c 2006-04-14 23:42:06.000000000 -0700 @@ -1115,7 +1115,7 @@ struct tpm_chip *tpm_register_hardware(s chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES); - if (chip->dev_num < 0 || chip->dev_num > TPM_NUM_DEVICES) { + if (chip->dev_num >= TPM_NUM_DEVICES) { dev_err(dev, "No available tpm device numbers\n"); kfree(chip); return NULL; _