diff options
author | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-04-25 11:20:07 +0200 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-06-25 16:26:35 +0200 |
commit | c0dff1f4519e3b3c322415b822724d4207156859 (patch) | |
tree | 3f2f2897be4dce9f1c5c11191dc2e4f93e5cab3c /drivers/char/tpm/tpm-chip.c | |
parent | tpm_crb: fix mapping of the buffers (diff) | |
download | linux-c0dff1f4519e3b3c322415b822724d4207156859.tar.xz linux-c0dff1f4519e3b3c322415b822724d4207156859.zip |
tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown()
Fixes: 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Diffstat (limited to 'drivers/char/tpm/tpm-chip.c')
-rw-r--r-- | drivers/char/tpm/tpm-chip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 5bc530ccbb86..2ea2f1561e59 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -269,7 +269,8 @@ static void tpm_del_char_device(struct tpm_chip *chip) /* Make the driver uncallable. */ down_write(&chip->ops_sem); - tpm2_shutdown(chip, TPM2_SU_CLEAR); + if (chip->flags & TPM_CHIP_FLAG_TPM2) + tpm2_shutdown(chip, TPM2_SU_CLEAR); chip->ops = NULL; up_write(&chip->ops_sem); } |