From: Stefan Berger <[email protected]>

Check the return code from getting the TPM's timeouts and durations
and reject the driver if they could not be read.

Signed-off-by: Stefan Berger <[email protected]>
Signed-off-by: Rajiv Andrade <[email protected]>
(cherry picked from commit 7f326ed7ff221a109bf89288bf6c8f0142e3e75c)
---
 drivers/char/tpm/tpm_tis.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 7786c2b..d93bafd 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -617,7 +617,11 @@ static int tpm_tis_init(struct device *dev, 
resource_size_t start,
                dev_dbg(dev, "\tData Avail Int Support\n");
 
        /* get the timeouts before testing for irqs */
-       tpm_get_timeouts(chip);
+       if (tpm_get_timeouts(chip)) {
+               dev_err(dev, "Could not get TPM timeouts and durations\n");
+               rc = -ENODEV;
+               goto out_err;
+       }
 
        if (tpm_do_selftest(chip)) {
                dev_err(dev, "TPM self test failed\n");
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to