diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-02-25 11:58:48 +0100 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2023-09-04 20:56:09 +0200 |
commit | 9c377852ddfdc557b1370f196b0cfdf28d233460 (patch) | |
tree | 24dcb39c21aefc488e4d4703aca11049b3c71ec4 /drivers/char/tpm/tpm_crb.c | |
parent | Merge tag 'dmaengine-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
download | linux-9c377852ddfdc557b1370f196b0cfdf28d233460.tar.xz linux-9c377852ddfdc557b1370f196b0cfdf28d233460.zip |
tpm_crb: Fix an error handling path in crb_acpi_add()
Some error paths don't call acpi_put_table() before returning.
Branch to the correct place instead of doing some direct return.
Fixes: 4d2732882703 ("tpm_crb: Add support for CRB devices based on Pluton")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Matthew Garrett <mgarrett@aurora.tech>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/char/tpm/tpm_crb.c')
-rw-r--r-- | drivers/char/tpm/tpm_crb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 9eb1a1859012..65ff4d2fbe8d 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -797,12 +797,13 @@ static int crb_acpi_add(struct acpi_device *device) FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n", buf->header.length, ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON); - return -EINVAL; + rc = -EINVAL; + goto out; } crb_pluton = ACPI_ADD_PTR(struct tpm2_crb_pluton, buf, sizeof(*buf)); rc = crb_map_pluton(dev, priv, buf, crb_pluton); if (rc) - return rc; + goto out; } priv->sm = sm; |