[U-Boot] [PATCH 0/2] TPM minor fixes

Hi Simon,
Please find in this serie one bug fix and a typo cleanup.
Best Regards Christophe
Christophe Ricard (2): tpm: Fix fault in case CONFIG_DM_TPM is set without any TPM tpm: tpm_tis_lpc: fix typo
common/cmd_tpm.c | 2 +- drivers/tpm/Kconfig | 2 +- lib/tpm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)

In case CONFIG_DM_TPM was set without any TPM chipset configured a fault was generated (NULL pointer access).
Signed-off-by: Christophe Ricard christophe-h.ricard@st.com ---
common/cmd_tpm.c | 2 +- lib/tpm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/cmd_tpm.c b/common/cmd_tpm.c index add6bfb..6edf3e9 100644 --- a/common/cmd_tpm.c +++ b/common/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; } diff --git a/lib/tpm.c b/lib/tpm.c index 8a62216..f428d45 100644 --- a/lib/tpm.c +++ b/lib/tpm.c @@ -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); }

On 16 January 2016 at 16:17, Christophe Ricard christophe.ricard@gmail.com wrote:
In case CONFIG_DM_TPM was set without any TPM chipset configured a fault was generated (NULL pointer access).
Signed-off-by: Christophe Ricard christophe-h.ricard@st.com
common/cmd_tpm.c | 2 +- lib/tpm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

TPM_TIS_LPC is connected to the LPC bus, not I2C.
Signed-off-by: Christophe Ricard christophe-h.ricard@st.com ---
drivers/tpm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tpm/Kconfig b/drivers/tpm/Kconfig index 31b35f7..5a75f85 100644 --- a/drivers/tpm/Kconfig +++ b/drivers/tpm/Kconfig @@ -50,7 +50,7 @@ config TPM_TIS_LPC bool "Enable support for Infineon SLB9635/45 TPMs on LPC" depends on TPM && X86 help - This driver supports Infineon TPM devices connected on the I2C bus. + This driver supports Infineon TPM devices connected on the LPC bus. The usual tpm operations and the 'tpm' command can be used to talk to the device using the standard TPM Interface Specification (TIS) protocol

On 16 January 2016 at 16:17, Christophe Ricard christophe.ricard@gmail.com wrote:
TPM_TIS_LPC is connected to the LPC bus, not I2C.
Signed-off-by: Christophe Ricard christophe-h.ricard@st.com
drivers/tpm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
participants (2)
-
Christophe Ricard
-
Simon Glass