tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown()
PATCH 1/1 tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown()
--- drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/tpm/tpm-chip.c +2 -1
@@ -270,7 +270,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); }
Signature · 1 line
2.7.4
Quoted 4 lines · Jarkko Sakkinen
Reported-by Stefan Berger <[email protected]>drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/char/tpm/tpm-chip.c static void tpm_del_char_device(struct tpm_chip *chip) · line 277
Quoted 13 lines
drivers/char/tpm/tpm-chip.c +3
-1+++ b/drivers/char/tpm/tpm-chip.c@@ -270,7 +270,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); }
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
Quoted 8 lines · Jason Gunthorpe
Quoted 4 lines · Jarkko Sakkinen
Signed-off-by Jarkko Sakkinen <[email protected]>Reported-by Stefan Berger <[email protected]>drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Reviewed-by Jason Gunthorpe <[email protected]>Fixes 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization")
Thanks and thanks for the fixes line (forgot to add it) :)
/Jarkko
Quoted 14 lines
Quoted 13 lines
drivers/char/tpm/tpm-chip.c +3
-1+++ b/drivers/char/tpm/tpm-chip.c@@ -270,7 +270,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); }
Stefan Berger
Tested-byQuoted 7 lines · Jason Gunthorpe
Quoted 4 lines · Jarkko Sakkinen
Reported-by Stefan Berger <[email protected]>drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Fixes 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization")
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z