Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tpm_tis: Fix an error handling path in 'tpm_tis_core_init()'

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>

authored by

Christophe Jaillet and committed by
Jarkko Sakkinen
e96d5282 d2704808

+1 -1
+1 -1
drivers/char/tpm/tpm_tis_core.c
··· 952 952 953 953 rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor); 954 954 if (rc < 0) 955 - goto out_err; 955 + return rc; 956 956 957 957 priv->manufacturer_id = vendor; 958 958