Skip to content

Commit ae7e190

Browse files
author
Jarkko Sakkinen
committed
tpm: use tpm_transmit_cmd() in tpm2_probe()
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> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
1 parent eb5854e commit ae7e190

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/char/tpm/tpm2-cmd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,9 @@ int tpm2_probe(struct tpm_chip *chip)
941941
cmd.params.get_tpm_pt_in.property_id = cpu_to_be32(0x100);
942942
cmd.params.get_tpm_pt_in.property_cnt = cpu_to_be32(1);
943943

944-
rc = tpm_transmit(chip, (const u8 *)&cmd, sizeof(cmd), 0);
944+
rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), 0, NULL);
945945
if (rc < 0)
946946
return rc;
947-
else if (rc < TPM_HEADER_SIZE)
948-
return -EFAULT;
949947

950948
if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
951949
chip->flags |= TPM_CHIP_FLAG_TPM2;

0 commit comments

Comments
 (0)