Re: [PATCH v8 1/7] tpm: dynamically allocate the allocated_banks array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 24, 2019 at 04:49:04PM +0100, Roberto Sassu wrote:
> +	chip->allocated_banks = kcalloc(1, sizeof(*chip->allocated_banks),
> +					GFP_KERNEL);
> +	if (!chip->allocated_banks) {
> +		rc = -ENOMEM;
> +		goto out;
> +	}
> +
> +	chip->allocated_banks[0] = TPM2_ALG_SHA1;
> +	chip->nr_allocated_banks = 1;

Everything else looks nice in this patch except this.

You always branch for TPM 1.2, and it will always have just SHA1. This
is unnecessary.

/Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux