Commit b3ad7855 authored by Ben Boeckel's avatar Ben Boeckel Committed by Jarkko Sakkinen

trusted-keys: match tpm_get_ops on all return paths

The `tpm_get_ops` call at the beginning of the function is not paired
with a `tpm_put_ops` on this return path.

Cc: stable@vger.kernel.org
Fixes: f2219745 ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBen Boeckel <mathstuf@gmail.com>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent 83a775d5
...@@ -336,9 +336,9 @@ int tpm2_seal_trusted(struct tpm_chip *chip, ...@@ -336,9 +336,9 @@ int tpm2_seal_trusted(struct tpm_chip *chip,
rc = -EPERM; rc = -EPERM;
} }
if (blob_len < 0) if (blob_len < 0)
return blob_len; rc = blob_len;
else
payload->blob_len = blob_len; payload->blob_len = blob_len;
tpm_put_ops(chip); tpm_put_ops(chip);
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment