1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-18 08:23:24 +02:00

tpm: Fix fault in case CONFIG_DM_TPM is set without any TPM

In case CONFIG_DM_TPM was set without any TPM chipset configured a fault
was generated (NULL pointer access).

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
This commit is contained in:
Christophe Ricard
2016-01-21 23:19:13 +01:00
committed by Simon Glass
parent 3faf2216d9
commit 0e37d4c2c6
2 changed files with 2 additions and 2 deletions

View File

@@ -262,7 +262,7 @@ int tpm_init(void)
struct udevice *dev;
err = uclass_first_device(UCLASS_TPM, &dev);
if (err)
if (err || !dev)
return err;
return tpm_open(dev);
}