On the RZG2L platform, the advised
TF-A (https://github.com/renesas-rz/rzg_trusted-firmware-a/tree/v2.5/rzg2l)
does not pass any DTB blob to U-Boot.
On the other hand, the RZG2L part of U-Boot expects a DTB to be passed. It
means that if one flashes the latest TF-A as well as the mainline U-Boot,
it will crash trying to dereference the NULL DTB pointer before outputing
anything.
Check if the DTB pointer is NULL before trying to use it.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
- if (fdt_magic(atf_fdt_blob) == FDT_MAGIC) {
+ if (atf_fdt_blob && fdt_magic(atf_fdt_blob) == FDT_MAGIC) {
unsigned int i;
for (i = 0; i < ARRAY_SIZE(tfa_info); i++) {
if (!fdt_node_check_compatible(atf_fdt_blob, 0,
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
- if (fdt_magic(atf_fdt_blob) != FDT_MAGIC)
+ if (!atf_fdt_blob || fdt_magic(atf_fdt_blob) != FDT_MAGIC)
return -1;
if (is_rzg2l_board("renesas,r9a07g044l2"))
{
void *atf_fdt_blob = (void *)(rcar_atf_boot_args[1]);
- if (fdt_magic(atf_fdt_blob) == FDT_MAGIC)
+ if (atf_fdt_blob && fdt_magic(atf_fdt_blob) == FDT_MAGIC)
fdt_overlay_apply_node(fdt_blob, 0, atf_fdt_blob, 0);
}