aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorChristophe Ricard2016-01-21 23:19:13 +0100
committerSimon Glass2016-01-28 21:01:22 -0700
commit0e37d4c2c631b0e94b7e891a5b37650d9bbd143c (patch)
treea956c2811e69307134194cb04da0d074d8fcea2a /cmd
parent3faf2216d9649e2a22e6728194e9797cb46db933 (diff)
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 add6bfb416e..6edf3e9dc35 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;
}