Re: [PATCH V3 3/4] tpm: Append the final event log to the TPM event log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 11, 2019 at 01:55:17PM -0800, Matthew Garrett wrote:
> +	if (efi.tpm_final_log != EFI_INVALID_TABLE_ADDR &&
> +	    efi_tpm_final_log_size != 0) {
> +		if (tpm_log_version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {

Instead of nesting code heavily I would just:

if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
    efi_tpm_final_log_size == 0 ||
    tpm_log_version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
    goto out_memunmap;

And in the tail:

out_munmap:
	memunmap(final_tbl);
	memunmap(log_tb);
	return tpm_log_version;

err_munmap:
	memunmap(final_tbl);
	memunmap(log_tb);
	return -ENOMEM;
}

/Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux