On Tue, Jan 10, 2017 at 03:15:41PM -0500, Stefan Berger wrote:
>  ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
> -                      int len, unsigned int flags, const char *desc)
> +                      int len, size_t min_rx_len,

May as well make len size_t while you are here..

The const void * is also wrong and should get fixed someday..

>  ssize_t tpm_getcap(struct tpm_chip *chip, u32 subcap_id, cap_t *cap,
> -                const char *desc)
> +                const char *desc, size_t min_rx_length)

Nicer to make min_rx_length into min_cap_length:

> -     rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE, 0,
> -                           desc);
> +     rc = tpm_transmit_cmd(chip, &tpm_cmd, TPM_INTERNAL_RESULT_SIZE,
> +                           min_rx_length, 0, desc);

Then use 'TPM_HEADER_SIZE + min_cap_length'

> -     rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, NULL);
> +     rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, NULL,
> +                     TPM_HEADER_SIZE + sizeof(cap.timeout));

And this is just 'sizeof(cap.timeout)'

etc

Looks fine to me otherwise

Jason

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to