Commit 2c9b2289 authored by Jonathan McDowell's avatar Jonathan McDowell Committed by Greg Kroah-Hartman
Browse files

tpm: Clean up TPM space after command failure



[ Upstream commit e3aaebcb ]

tpm_dev_transmit prepares the TPM space before attempting command
transmission. However if the command fails no rollback of this
preparation is done. This can result in transient handles being leaked
if the device is subsequently closed with no further commands performed.

Fix this by flushing the space in the event of command transmission
failure.

Fixes: 745b361e ("tpm: infrastructure for TPM spaces")
Signed-off-by: default avatarJonathan McDowell <noodles@meta.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a0a8b7be
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment