Skip to contentSkip to conversation

tpm: don't print error message in tpm_transmit_cmd when tpm still testing

PATCH In review Jerry Snitselaar 2 participants 2 messages Jan 29, 2019 – Jan 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: don't print error message in tpm_transmit_cmd when tpm still testing

Currently tpm_transmit_cmd will print an error message if the tpm returns something other than TPM2_RC_SUCCESS. This means that if the tpm returns that it is testing an error message will be printed, and this can cause confusion for the end user. So avoid printing the error message if TPM2_RC_TESTING is the return code.

Cc Peter Huewe <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Jason Gunthorpe <[email protected]>
---
 drivers/char/tpm/tpm-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm-interface.c +1 -1
index d9439f9abe78..6339a2e289ae 100644
@@ -397,7 +397,7 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_space *space,
 
 	err = be32_to_cpu(header->return_code);
 	if (err != 0 && err != TPM_ERR_DISABLED && err != TPM_ERR_DEACTIVATED
-	    && desc)
+	    && err != TPM2_RC_TESTING && desc)
 		dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
 			desc);
 	if (err)
Signature · 1 line
2.20.1.98.gecbdaf0899
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Jerry Snitselaar

Currently tpm_transmit_cmd will print an error message if the tpm returns something other than TPM2_RC_SUCCESS. This means that if the tpm returns that it is testing an error message will be printed, and this can cause confusion for the end user. So avoid printing the error message if TPM2_RC_TESTING is the return code.

Cc Peter Huewe <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Jason Gunthorpe <[email protected]>

And applied. Thanks.

/Jarkko