diff mbox series

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

Message ID 20190129185911.13559-1-jsnitsel@redhat.com (mailing list archive)
State New, archived
Headers show
Series tpm: don't print error message in tpm_transmit_cmd when tpm still testing | expand

Commit Message

Jerry Snitselaar Jan. 29, 2019, 6:59 p.m. UTC
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 <peterhuewe@gmx.de>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
---
 drivers/char/tpm/tpm-interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jarkko Sakkinen Jan. 30, 2019, 9:22 p.m. UTC | #1
On Tue, Jan 29, 2019 at 11:59:11AM -0700, Jerry Snitselaar wrote:
> 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 <peterhuewe@gmx.de>
> Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

And applied. Thanks.

/Jarkko
diff mbox series

Patch

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index d9439f9abe78..6339a2e289ae 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -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)