Commit ee1c7bd3 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 60a8db79 2d6c2521
...@@ -1228,24 +1228,11 @@ static int __init trusted_shash_alloc(void) ...@@ -1228,24 +1228,11 @@ static int __init trusted_shash_alloc(void)
static int __init init_digests(void) 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), digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
GFP_KERNEL); GFP_KERNEL);
if (!digests) if (!digests)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < chip->nr_allocated_banks; i++)
memcpy(digests[i].digest, digest, TPM_MAX_DIGEST_SIZE);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment