summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm2-space.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/tpm2-space.c')
-rw-r--r--drivers/char/tpm/tpm2-space.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm2-space.c b/drivers/char/tpm/tpm2-space.c
index 4e4014eabdb9c..6122d3276f722 100644
--- a/drivers/char/tpm/tpm2-space.c
+++ b/drivers/char/tpm/tpm2-space.c
@@ -102,8 +102,9 @@ static int tpm2_load_context(struct tpm_chip *chip, u8 *buf,
* TPM_RC_REFERENCE_H0 means the session has been
* flushed outside the space
*/
- rc = -ENOENT;
+ *handle = 0;
tpm_buf_destroy(&tbuf);
+ return -ENOENT;
} else if (rc > 0) {
dev_warn(&chip->dev, "%s: failed with a TPM error 0x%04X\n",
__func__, rc);