Skip to content

Commit 29cb797

Browse files
uudiinJarkko Sakkinen
authored andcommitted
tpm: fix wrong return value in tpm_pcr_extend
For the algorithm that does not match the bank, a positive value EINVAL is returned here. I think this is a typo error. It is necessary to return an error value. Cc: [email protected] # 5.4.x Fixes: 9f75c82 ("KEYS: trusted: correctly initialize digests and fix locking issue") Signed-off-by: Tianjia Zhang <[email protected]> Reviewed-by: Roberto Sassu <[email protected]> Reviewed-by: Jerry Snitselaar <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent eba5cf3 commit 29cb797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/tpm/tpm-interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx,
323323

324324
for (i = 0; i < chip->nr_allocated_banks; i++) {
325325
if (digests[i].alg_id != chip->allocated_banks[i].alg_id) {
326-
rc = EINVAL;
326+
rc = -EINVAL;
327327
goto out;
328328
}
329329
}

0 commit comments

Comments
 (0)