OSDN Git Service

tpm_tis: Fix an error handling path in 'tpm_tis_core_init()'
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sat, 6 Nov 2021 16:42:04 +0000 (17:42 +0100)
committerJarkko Sakkinen <jarkko@kernel.org>
Sat, 8 Jan 2022 22:18:41 +0000 (00:18 +0200)
Commit 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent
queries") has moved some code around without updating the error handling
path.

This is now pointless to 'goto out_err' when neither 'clk_enable()' nor
'ioremap()' have been called yet.

Make a direct return instead to avoid undoing things that have not been
done.

Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries")
Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_tis_core.c

index e2df109..36d1ad8 100644 (file)
@@ -952,7 +952,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
 
        rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor);
        if (rc < 0)
-               goto out_err;
+               return rc;
 
        priv->manufacturer_id = vendor;