aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2009-09-18 15:54:24 -0400
committerJames Morris <jmorris@namei.org>2009-09-23 14:03:40 -0400
commit0afd9056f1b43c9fcbfdf933b263d72023d382fe (patch)
treef590f4afa4f090c8655c8536684068cdf13ca4d9 /drivers/char/tpm/tpm.c
parent764db03fee50f7a3de91de80ef4a943f0d720801 (diff)
tpm-fixup-pcrs-sysfs-file-update
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Cc: Debora Velarde <debora@linux.vnet.ibm.com> Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com> Cc: Marcel Selhorst <m.selhorst@sirrix.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tpm/tpm.c')
-rw-r--r--drivers/char/tpm/tpm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index b0603b2e5684..1f32b520ca26 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -742,7 +742,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
742 * the module usage count. 742 * the module usage count.
743 */ 743 */
744#define TPM_ORD_PCR_EXTEND cpu_to_be32(20) 744#define TPM_ORD_PCR_EXTEND cpu_to_be32(20)
745#define EXTEND_PCR_SIZE 34 745#define EXTEND_PCR_RESULT_SIZE 34
746static struct tpm_input_header pcrextend_header = { 746static struct tpm_input_header pcrextend_header = {
747 .tag = TPM_TAG_RQU_COMMAND, 747 .tag = TPM_TAG_RQU_COMMAND,
748 .length = cpu_to_be32(34), 748 .length = cpu_to_be32(34),
@@ -760,10 +760,9 @@ int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash)
760 return -ENODEV; 760 return -ENODEV;
761 761
762 cmd.header.in = pcrextend_header; 762 cmd.header.in = pcrextend_header;
763 BUILD_BUG_ON(be32_to_cpu(cmd.header.in.length) > EXTEND_PCR_SIZE);
764 cmd.params.pcrextend_in.pcr_idx = cpu_to_be32(pcr_idx); 763 cmd.params.pcrextend_in.pcr_idx = cpu_to_be32(pcr_idx);
765 memcpy(cmd.params.pcrextend_in.hash, hash, TPM_DIGEST_SIZE); 764 memcpy(cmd.params.pcrextend_in.hash, hash, TPM_DIGEST_SIZE);
766 rc = transmit_cmd(chip, &cmd, cmd.header.in.length, 765 rc = transmit_cmd(chip, &cmd, EXTEND_PCR_RESULT_SIZE,
767 "attempting extend a PCR value"); 766 "attempting extend a PCR value");
768 767
769 module_put(chip->dev->driver->owner); 768 module_put(chip->dev->driver->owner);