tpm: vtpm_proxy: Suppresse error logging when in closed state
Subsystems (2)
PATCH v2 1/1 tpm: vtpm_proxy: Suppresse error logging when in closed state
Suppress the error logging when the core TPM driver sends commands to the VTPM proxy driver and -EPIPE is returned in case the VTPM proxy driver is 'closed' (closed anonymous file descriptor). This error code is only returned by the send function and by tpm_transmit when the VTPM proxy driver is being used.
--- drivers/char/tpm/tpm-interface.c | 4 ++-- drivers/char/tpm/tpm2-cmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/char/tpm/tpm-interface.c +2 -2
@@ -429,11 +429,11 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, goto out; rc = chip->ops->send (chip, (u8 *) buf, count); -if (rc <0 ) { +if (rc <0 && rc != -EPIPE )dev_err (&chip->dev,"tpm_transmit: tpm_send: error %d\n" , rc); +if (rc <0 ) goto out; - }if (chip->flags &TPM_CHIP_FLAG_IRQ ) goto out_recv;
drivers/char/tpm/tpm2-cmd.c +1 -1
@@ -840,7 +840,7 @@ void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type)/* In places where shutdown command is sent there's no much we can do * except print the error code on a system failure. */ -if (rc <0 ) +if (rc <0 && rc != -EPIPE )dev_warn (&chip->dev,"transmit returned %d while stopping the TPM" , rc); }
Signature · 6 lines
2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Stefan Berger
Suppress the error logging when the core TPM driver sends commands to the VTPM proxy driver and
-EPIPEis returned in case the VTPM proxy driver is 'closed' (closed anonymous file descriptor). This error code is only returned by the send function and bytpm_transmitwhen the VTPM proxy driver is being used.Signed-off-by Stefan Berger <[email protected]>--- drivers/char/tpm/tpm-interface.c | 4 ++-- drivers/char/tpm/tpm2-cmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/char/tpm/tpm-interface.c +0
-0
drivers/char/tpm/tpm-interface.c ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, · line 436
Quoted 9 lines
drivers/char/tpm/tpm-interface.c +2
-1@@ -429,11 +429,11 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, goto out; rc = chip->ops->send (chip, (u8 *) buf, count); -if (rc <0 ) { +if (rc <0 && rc != -EPIPE )dev_err (&chip->dev,"tpm_transmit: tpm_send: error %d\n" , rc); +if (rc <0 ) goto out;
Perhaps this would read better as
if (rc < 0) {
if (rc != -EPIPE)
dev_err(etc...);
goto out;
}though for etc, perhaps
dev_err(&chip->dev, "%s: %tpm_send: error %d\n", __func__, rc);
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Stefan Berger
Suppress the error logging when the core TPM driver sends commands to the VTPM proxy driver and
-EPIPEis returned in case the VTPM proxy driver is 'closed' (closed anonymous file descriptor). This error code is only returned by the send function and bytpm_transmitwhen the VTPM proxy driver is being used.Signed-off-by Stefan Berger <[email protected]>
This have to hold up until some time next week as I have to make sure that I understand that this is the right choice, which requirest to study vtpm implementation.
I'm travelling right now.
/Jarkko
Quoted 39 lines
--- drivers/char/tpm/tpm-interface.c | 4 ++-- drivers/char/tpm/tpm2-cmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/char/tpm/tpm-interface.c +2
-2@@ -429,11 +429,11 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space, goto out; rc = chip->ops->send (chip, (u8 *) buf, count); -if (rc <0 ) { +if (rc <0 && rc != -EPIPE )dev_err (&chip->dev,"tpm_transmit: tpm_send: error %d\n" , rc); +if (rc <0 ) goto out; - }if (chip->flags &TPM_CHIP_FLAG_IRQ ) goto out_recv;drivers/char/tpm/tpm2-cmd.c +1
-1@@ -840,7 +840,7 @@ void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type)/* In places where shutdown command is sent there's no much we can do * except print the error code on a system failure. */ -if (rc <0 ) +if (rc <0 && rc != -EPIPE )dev_warn (&chip->dev,"transmit returned %d while stopping the TPM" , rc); }Signature · 1 line
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html