提交 2490c681 编写于 作者: D David Smith 提交者: Linus Torvalds

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: NPavel Machek <pavel@ucw.cz>
Cc: Kent Yoder <shpedoikal@gmail.com>
Cc: Marcel Selhorst <tpm@selhorst.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 40d6a146
...@@ -1046,12 +1046,6 @@ void tpm_remove_hardware(struct device *dev) ...@@ -1046,12 +1046,6 @@ void tpm_remove_hardware(struct device *dev)
} }
EXPORT_SYMBOL_GPL(tpm_remove_hardware); EXPORT_SYMBOL_GPL(tpm_remove_hardware);
static u8 savestate[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 10, /* blob length (in bytes) */
0, 0, 0, 152 /* TPM_ORD_SaveState */
};
/* /*
* We are about to suspend. Save the TPM state * We are about to suspend. Save the TPM state
* so that it can be restored. * so that it can be restored.
...@@ -1059,6 +1053,12 @@ static u8 savestate[] = { ...@@ -1059,6 +1053,12 @@ static u8 savestate[] = {
int tpm_pm_suspend(struct device *dev, pm_message_t pm_state) int tpm_pm_suspend(struct device *dev, pm_message_t pm_state)
{ {
struct tpm_chip *chip = dev_get_drvdata(dev); struct tpm_chip *chip = dev_get_drvdata(dev);
u8 savestate[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 10, /* blob length (in bytes) */
0, 0, 0, 152 /* TPM_ORD_SaveState */
};
if (chip == NULL) if (chip == NULL)
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册