mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
arm/efi: Fix null pointer dereference
Fix for commit60649d443dthat introduces a null pointer dereference when the fdt_node_offset_by_compatible is called with "fdt" argument null. Reported-by: Julien Grall <julien@xen.org> Fixes:60649d443d("arm/efi: Introduce xen,uefi-cfg-load DT property") Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
f38c859135
commit
4817dbf1c8
1 file changed
+2
-1
@@ -593,7 +593,8 @@ static bool __init efi_arch_use_config_file(EFI_SYSTEM_TABLE *SystemTable)
|
||||
dtbfile.ptr = fdt;
|
||||
dtbfile.need_to_free = false; /* Config table memory can't be freed. */
|
||||
|
||||
if ( fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") > 0 )
|
||||
if ( fdt &&
|
||||
(fdt_node_offset_by_compatible(fdt, 0, "multiboot,module") > 0) )
|
||||
{
|
||||
/* Locate chosen node */
|
||||
int node = fdt_subnode_offset(fdt, 0, "chosen");
|
||||
|
||||