summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2016-01-21 23:19:13 +0100
committerSimon Glass <sjg@chromium.org>2016-01-28 21:01:22 -0700
commit0e37d4c2c631b0e94b7e891a5b37650d9bbd143c (patch)
treea956c2811e69307134194cb04da0d074d8fcea2a /cmd
parent3faf2216d9649e2a22e6728194e9797cb46db933 (diff)
downloadu-boot-imx-0e37d4c2c631b0e94b7e891a5b37650d9bbd143c.zip
u-boot-imx-0e37d4c2c631b0e94b7e891a5b37650d9bbd143c.tar.gz
u-boot-imx-0e37d4c2c631b0e94b7e891a5b37650d9bbd143c.tar.bz2
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>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/tpm.c b/cmd/tpm.c
index add6bfb..6edf3e9 100644
--- a/cmd/tpm.c
+++ b/cmd/tpm.c
@@ -448,7 +448,7 @@ static int get_tpm(struct udevice **devp)
int rc;
rc = uclass_first_device(UCLASS_TPM, devp);
- if (rc) {
+ if (rc || !*devp) {
printf("Could not find TPM (ret=%d)\n", rc);
return CMD_RET_FAILURE;
}