lkml.org 
[lkml]   [2018]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/5] tpm: migrate tpm2_probe() to use struct tpm_buf
From
Date
.
.
.
I'm new to this area of the kernel, but I'm not getting these lines:

> + rc = tpm_transmit_cmd(chip, NULL, buf.data, PAGE_SIZE, 0, 0, NULL);
> + tpm_buf_destroy(&buf);
> if (rc < 0)
Why is this if() check not directly after the tpm_transmit_cmd() call
that sets rc?  Is it correct you want to destroy buf regardless of the
tpm_transmit_cmd() outcome?
> return rc;
> -
> - if (be16_to_cpu(cmd.header.out.tag) == TPM2_ST_NO_SESSIONS)
> + out = (struct tpm_output_header *)buf.data;

So buf has been destroyed, buf.data sill has something valid to assign
to out?
> + if (be16_to_cpu(out->tag) == TPM2_ST_NO_SESSIONS)
> chip->flags |= TPM_CHIP_FLAG_TPM2;
>
> return 0;
Thanks,
Jay

\
 
 \ /
  Last update: 2018-03-01 23:11    [W:0.383 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site