]> git.baikalelectronics.ru Git - uboot.git/commit
tis: fix tpm_tis_remove()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 28 Nov 2021 23:03:44 +0000 (00:03 +0100)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 30 Nov 2021 12:11:05 +0000 (14:11 +0200)
commit1f38b4da9a792baf3eafd25b3374bd577d2dfd0f
treeecd155d8e96bcf38bdf43fabeceb44fb138b6a28
parent354ad1a2f066243c79840c17f5de6eb953bec115
tis: fix tpm_tis_remove()

tpm_tis_remove() leads to calling tpm_tis_ready() with the IO region
unmapped and chip->locality == -1 (locality released). This leads to a
crash in mmio_write_bytes().

The patch implements these changes:

tpm_tis_remove(): Unmap the IO region after calling tpm_tis_cleanup().

tpm_tis_cleanup(): Request locality before IO output and releasing
locality.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
drivers/tpm/tpm2_tis_core.c
drivers/tpm/tpm2_tis_mmio.c