tpmdd fixes for Linux v5.3-rc4
-----BEGIN PGP SIGNATURE----- iJYEABYIAD4WIQRE6pSOnaBC00OEHEIaerohdGur0gUCXVLtdiAcamFya2tvLnNh a2tpbmVuQGxpbnV4LmludGVsLmNvbQAKCRAaerohdGur0uadAP0dqXGizY45Bxtx wZHJaZZWiCj7bINI5mOym5AYwdtaCQEA5PlQ3ESHs6jqEu743jOlzLCmtk0l5Q3o LL19MYOhswU= =CuCU -----END PGP SIGNATURE----- Merge tag 'tpmdd-next-20190813' of git://git.infradead.org/users/jjs/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen: "One more bug fix for the next release" * tag 'tpmdd-next-20190813' of git://git.infradead.org/users/jjs/linux-tpmdd: KEYS: trusted: allow module init if TPM is inactive or deactivated
This commit is contained in:
commit
ee1c7bd33e
|
@ -1228,24 +1228,11 @@ hashalg_fail:
|
|||
|
||||
static int __init init_digests(void)
|
||||
{
|
||||
u8 digest[TPM_MAX_DIGEST_SIZE];
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
ret = tpm_get_random(chip, digest, TPM_MAX_DIGEST_SIZE);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret < TPM_MAX_DIGEST_SIZE)
|
||||
return -EFAULT;
|
||||
|
||||
digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
|
||||
GFP_KERNEL);
|
||||
if (!digests)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < chip->nr_allocated_banks; i++)
|
||||
memcpy(digests[i].digest, digest, TPM_MAX_DIGEST_SIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue