mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86/tboot: check return value of dmar_table allocation
The allocation can just return NULL. Return an error value early instead of crashing later on. Signed-off-by: Hongyan Xia <hongyxia@amazon.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
f10df652c7
commit
daed26bb7f
1 file changed
+2
@@ -480,6 +480,8 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler)
|
||||
sizeof(dmar_table_length),
|
||||
pa + sizeof(char) * ACPI_NAME_SIZE);
|
||||
dmar_table = xmalloc_bytes(dmar_table_length);
|
||||
if ( !dmar_table )
|
||||
return -ENOMEM;
|
||||
tboot_copy_memory(dmar_table, dmar_table_length, pa);
|
||||
clear_fixmap(FIX_TBOOT_MAP_ADDRESS);
|
||||
|
||||
|
||||