mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
Hi,
Updates for the TPM driver (yep, only one patch). BR, Jarkko -----BEGIN PGP SIGNATURE----- iHQEABYKAB0WIQRE6pSOnaBC00OEHEIaerohdGur0gUCZ5IEIgAKCRAaerohdGur 0hXZAP0f6M8O1t9ZffklflNXJMdWk/i0p7NkU6tvlpOD6FnGzgD4+3nOLL5rtzMs bU5vhJvJX5g6H45a0z6YIXsO1Yi4Dw== =kpgF -----END PGP SIGNATURE----- Merge tag 'tpmdd-next-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull TPM update from Jarkko Sakkinen. * tag 'tpmdd-next-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm: Change to kvalloc() in eventlog/acpi.c
This commit is contained in:
commit
ae2d4fc540
|
|
@ -63,6 +63,11 @@ static bool tpm_is_tpm2_log(void *bios_event_log, u64 len)
|
|||
return n == 0;
|
||||
}
|
||||
|
||||
static void tpm_bios_log_free(void *data)
|
||||
{
|
||||
kvfree(data);
|
||||
}
|
||||
|
||||
/* read binary bios log */
|
||||
int tpm_read_log_acpi(struct tpm_chip *chip)
|
||||
{
|
||||
|
|
@ -136,7 +141,7 @@ int tpm_read_log_acpi(struct tpm_chip *chip)
|
|||
}
|
||||
|
||||
/* malloc EventLog space */
|
||||
log->bios_event_log = devm_kmalloc(&chip->dev, len, GFP_KERNEL);
|
||||
log->bios_event_log = kvmalloc(len, GFP_KERNEL);
|
||||
if (!log->bios_event_log)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -161,10 +166,16 @@ int tpm_read_log_acpi(struct tpm_chip *chip)
|
|||
goto err;
|
||||
}
|
||||
|
||||
ret = devm_add_action(&chip->dev, tpm_bios_log_free, log->bios_event_log);
|
||||
if (ret) {
|
||||
log->bios_event_log = NULL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
return format;
|
||||
|
||||
err:
|
||||
devm_kfree(&chip->dev, log->bios_event_log);
|
||||
tpm_bios_log_free(log->bios_event_log);
|
||||
log->bios_event_log = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user