提交 c0dff1f4 编写于 作者: J Jarkko Sakkinen

tpm: check for TPM_CHIP_FLAG_TPM2 before calling tpm2_shutdown()

Fixes: 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization")
Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reported-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Tested-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-By: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
上级 422eac3f
......@@ -269,6 +269,7 @@ static void tpm_del_char_device(struct tpm_chip *chip)
/* Make the driver uncallable. */
down_write(&chip->ops_sem);
if (chip->flags & TPM_CHIP_FLAG_TPM2)
tpm2_shutdown(chip, TPM2_SU_CLEAR);
chip->ops = NULL;
up_write(&chip->ops_sem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册