Fix for commit
60649d443dc395243e74d2b3e05594ac0c43cfe3
that 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>
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");