Re: [PATCH v3 1/5] tpm: change the end marker of the active_banks array to zero

From: Mimi Zohar
Date: Mon Nov 05 2018 - 08:02:43 EST



> >>> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> >>> index 1a803b0cf980..f7fc4b5ee239 100644
> >>> --- a/drivers/char/tpm/tpm-interface.c
> >>> +++ b/drivers/char/tpm/tpm-interface.c
> >>> @@ -1051,7 +1051,7 @@ int tpm_pcr_extend(struct tpm_chip *chip, int pcr_idx, const u8 *hash)
> >>> memset(digest_list, 0, sizeof(digest_list));
> >>>
> >>> for (i = 0; i < ARRAY_SIZE(chip->active_banks) &&
> >>> - chip->active_banks[i] != TPM2_ALG_ERROR; i++) {
> >>> + chip->active_banks[i]; i++) {
> >>> digest_list[i].alg_id = chip->active_banks[i];
> >>> memcpy(digest_list[i].digest, hash, TPM_DIGEST_SIZE);
> >>> count++;
> >
> > The fourth patch further updates this code. ÂPlease move those changes
> > to this first patch. ÂNo need to touch the same code in both places.
>
> alg_id is introduced in patch 4/5. It cannot be moved here.

Thanks, I missed that.

Mimi