Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1425486 > unrolled thread

[PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe()

Started byJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
First post2016-06-17 23:20 +0200
Last post2016-06-17 23:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-06-17 23:20 +0200

#1425486 — [PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe()

FromJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Date2016-06-17 23:20 +0200
Subject[PATCH 3/5] tpm: use tpm_transmit_cmd() in tpm2_probe()
Message-ID<rL9lf-3mT-13@gated-at.bofh.it>
It is better to tpm_transmit_cmd() in tpm2_probe() in order to get
consistent command handling throughout the subsystem.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm2-cmd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 77ef027..a43e51a 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -913,11 +913,9 @@ int tpm2_probe(struct tpm_chip *chip)
 	cmd.params.get_tpm_pt_in.property_id = cpu_to_be32(0x100);
 	cmd.params.get_tpm_pt_in.property_cnt = cpu_to_be32(1);
 
-	rc = tpm_transmit(chip, (const char *) &cmd, sizeof(cmd));
+	rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), NULL);
 	if (rc <  0)
 		return rc;
-	else if (rc < TPM_HEADER_SIZE)
-		return -EFAULT;
 
 	if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
 		chip->flags |= TPM_CHIP_FLAG_TPM2;
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web