mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 21:45:08 -04:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user