diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2021-03-10 23:19:16 +0100 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2021-04-14 15:30:30 +0200 |
commit | 9716ac65efc8f780549b03bddf41e60c445d4709 (patch) | |
tree | 4ec00dce1ae6d2e4eaa229f6b81393c870c33c8a /drivers/char | |
parent | tpm: acpi: Check eventlog signature before using it (diff) | |
download | linux-9716ac65efc8f780549b03bddf41e60c445d4709.tar.xz linux-9716ac65efc8f780549b03bddf41e60c445d4709.zip |
tpm: vtpm_proxy: Avoid reading host log when using a virtual device
Avoid allocating memory and reading the host log when a virtual device
is used since this log is of no use to that driver. A virtual
device can be identified through the flag TPM_CHIP_FLAG_VIRTUAL, which
is only set for the tpm_vtpm_proxy driver.
Cc: stable@vger.kernel.org
Fixes: 6f99612e2500 ("tpm: Proxy driver for supporting multiple emulated TPMs")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/eventlog/common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/tpm/eventlog/common.c b/drivers/char/tpm/eventlog/common.c index 7460f230bae4..8512ec76d526 100644 --- a/drivers/char/tpm/eventlog/common.c +++ b/drivers/char/tpm/eventlog/common.c @@ -107,6 +107,9 @@ void tpm_bios_log_setup(struct tpm_chip *chip) int log_version; int rc = 0; + if (chip->flags & TPM_CHIP_FLAG_VIRTUAL) + return; + rc = tpm_read_log(chip); if (rc < 0) return; |