aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm.c
diff options
context:
space:
mode:
authorDavid Smith <dds@google.com>2008-01-14 03:55:12 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-14 11:52:22 -0500
commit2490c681ea3d7f5ac3fb876f14567bf1a9e0aa87 (patch)
tree1e5f1e5280cacc2db866a9f08b04d52702596898 /drivers/char/tpm/tpm.c
parent40d6a146629b98d8e322b6f9332b182c7cbff3df (diff)
TPM: fix suspend and resume failure
The savestate command structure was being overwritten by the result of running the TPM_SaveState command after one run, so make it a local variable to the function instead of a global variable that gets overwritten. Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Kent Yoder <shpedoikal@gmail.com> Cc: Marcel Selhorst <tpm@selhorst.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r--drivers/char/tpm/tpm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 39564b76d4a3..c88424a0c89b 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1046,12 +1046,6 @@ void tpm_remove_hardware(struct device *dev)
1046} 1046}
1047EXPORT_SYMBOL_GPL(tpm_remove_hardware); 1047EXPORT_SYMBOL_GPL(tpm_remove_hardware);
1048 1048
1049static u8 savestate[] = {
1050 0, 193, /* TPM_TAG_RQU_COMMAND */
1051 0, 0, 0, 10, /* blob length (in bytes) */
1052 0, 0, 0, 152 /* TPM_ORD_SaveState */
1053};
1054
1055/* 1049/*
1056 * We are about to suspend. Save the TPM state 1050 * We are about to suspend. Save the TPM state
1057 * so that it can be restored. 1051 * so that it can be restored.
@@ -1059,6 +1053,12 @@ static u8 savestate[] = {
1059int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) 1053int tpm_pm_suspend(struct device *dev, pm_message_t pm_state)
1060{ 1054{
1061 struct tpm_chip *chip = dev_get_drvdata(dev); 1055 struct tpm_chip *chip = dev_get_drvdata(dev);
1056 u8 savestate[] = {
1057 0, 193, /* TPM_TAG_RQU_COMMAND */
1058 0, 0, 0, 10, /* blob length (in bytes) */
1059 0, 0, 0, 152 /* TPM_ORD_SaveState */
1060 };
1061
1062 if (chip == NULL) 1062 if (chip == NULL)
1063 return -ENODEV; 1063 return -ENODEV;
1064 1064