---------- Forwarded message ----------
Date: Mon, 24 Jan 2011 10:59:05 GMT
From: Linux Kernel Mailing List <[email protected]>
To: [email protected]
Subject: tpm: fix panic caused by "tpm: Autodetect itpm devices"

Gitweb:     http://git.kernel.org/linus/e5cce6c13c25d9ac56955a3ae2fd562719848172
Commit:     e5cce6c13c25d9ac56955a3ae2fd562719848172
Parent:     c4ff4b829ef9e6353c0b133b7adb564a68054979
Author:     Olof Johansson <[email protected]>
AuthorDate: Thu Jan 6 21:24:01 2011 -0600
Committer:  James Morris <[email protected]>
CommitDate: Mon Jan 24 11:29:55 2011 +1100

    tpm: fix panic caused by "tpm: Autodetect itpm devices"
    
    commit 3f0d3d016d89a5efb8b926d4707eb21fa13f3d27 adds a check for
    PNP device id to the common tpm_tis_init() function, which in some
    cases (force=1) will be called without the device being a member of
    a pnp_dev. Oopsing and panics ensue.
    
    Move the test up to before the call to tpm_tis_init(), since it
    just modifies a global variable anyway.
    
    Signed-off-by: Olof Johansson <[email protected]>
    Acked-by: Rajiv Andrade <[email protected]>
    Signed-off-by: James Morris <[email protected]>
---
 drivers/char/tpm/tpm_tis.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index c17a305..dd21df5 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -493,9 +493,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t 
start,
                 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
                 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
 
-       if (is_itpm(to_pnp_dev(dev)))
-               itpm = 1;
-
        if (itpm)
                dev_info(dev, "Intel iTPM workaround enabled\n");
 
@@ -637,6 +634,9 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev 
*pnp_dev,
        else
                interrupts = 0;
 
+       if (is_itpm(pnp_dev))
+               itpm = 1;
+
        return tpm_tis_init(&pnp_dev->dev, start, len, irq);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to