Patch "tpm_crb: Fix an error handling path in crb_acpi_add()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tpm_crb: Fix an error handling path in crb_acpi_add()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tpm_crb-fix-an-error-handling-path-in-crb_acpi_add.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 52240651edd1f073a188d3c97c67b627bc4f1d9d
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sat Feb 25 11:58:48 2023 +0100

    tpm_crb: Fix an error handling path in crb_acpi_add()
    
    [ Upstream commit 9c377852ddfdc557b1370f196b0cfdf28d233460 ]
    
    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@xxxxxxxxxx>
    Acked-by: Matthew Garrett <mgarrett@xxxxxxxxxxx>
    Reviewed-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index db0b774207d35..f45239e73c4ca 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -775,12 +775,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;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux