tpm: replace kmalloc() + memcpy() with kmemdup()
Use kmemdup rather than duplicating its implementation. Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Reviewed-by: James Morris <james.morris@microsoft.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkine@linux.intel.com>
This commit is contained in:
parent
697989164e
commit
f5495bb9ac
|
@ -51,10 +51,9 @@ int tpm_read_log_efi(struct tpm_chip *chip)
|
|||
}
|
||||
|
||||
/* malloc EventLog space */
|
||||
log->bios_event_log = kmalloc(log_size, GFP_KERNEL);
|
||||
log->bios_event_log = kmemdup(log_tbl->log, log_size, GFP_KERNEL);
|
||||
if (!log->bios_event_log)
|
||||
goto err_memunmap;
|
||||
memcpy(log->bios_event_log, log_tbl->log, log_size);
|
||||
log->bios_event_log_end = log->bios_event_log + log_size;
|
||||
|
||||
tpm_log_version = log_tbl->version;
|
||||
|
|
Loading…
Reference in New Issue