Skip to content

Commit 9c37785

Browse files
tititiou36jarkkojs
authored andcommitted
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: 4d27328 ("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>
1 parent 708283a commit 9c37785

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/char/tpm/tpm_crb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,13 @@ static int crb_acpi_add(struct acpi_device *device)
797797
FW_BUG "TPM2 ACPI table has wrong size %u for start method type %d\n",
798798
buf->header.length,
799799
ACPI_TPM2_COMMAND_BUFFER_WITH_PLUTON);
800-
return -EINVAL;
800+
rc = -EINVAL;
801+
goto out;
801802
}
802803
crb_pluton = ACPI_ADD_PTR(struct tpm2_crb_pluton, buf, sizeof(*buf));
803804
rc = crb_map_pluton(dev, priv, buf, crb_pluton);
804805
if (rc)
805-
return rc;
806+
goto out;
806807
}
807808

808809
priv->sm = sm;

0 commit comments

Comments
 (0)