summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMathieu Othacehe <[email protected]>2025-09-22 18:29:00 +0200
committerMarek Vasut <[email protected]>2025-09-25 23:18:34 +0200
commit9c7e61fccc65974fc970c587bddcd5857b334852 (patch)
treee6585acba71375ad573f671d9ffbf39a90d7565d /arch
parentf53fe908ac3dd44f7ad63dff319636541710b98c (diff)
board: rzg2l: Check the DTB pointer passed by the TF-A.
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 <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-renesas/cpu_info-rzg2l.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-renesas/cpu_info-rzg2l.c b/arch/arm/mach-renesas/cpu_info-rzg2l.c
index ab95ce76388..a9cb9f72dd3 100644
--- a/arch/arm/mach-renesas/cpu_info-rzg2l.c
+++ b/arch/arm/mach-renesas/cpu_info-rzg2l.c
@@ -30,7 +30,7 @@ static const struct tfa_info *get_tfa_info(void)
{
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,