diff options
author | Mark Dykes <mardyk01@review.trustedfirmware.org> | 2020-09-14 21:49:38 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2020-09-14 21:49:38 +0000 |
commit | 1aabb74fae0e30901884b6cb230d7ea730a74344 (patch) | |
tree | 49214f6120941983c5ce7ffcf8745a80bdf52409 | |
parent | 34029d01c6effbbd643413b69c851cc24d047eaa (diff) | |
parent | e7b586987c0a46660aa8402f19d626a5489fe449 (diff) | |
download | trusted-firmware-a-1aabb74fae0e30901884b6cb230d7ea730a74344.tar.gz |
Merge "rockchip: don't crash if we get an FDT we can't parse" into integration
-rw-r--r-- | plat/rockchip/common/params_setup.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/plat/rockchip/common/params_setup.c b/plat/rockchip/common/params_setup.c index 2ff81eda79..aec53eee2e 100644 --- a/plat/rockchip/common/params_setup.c +++ b/plat/rockchip/common/params_setup.c @@ -230,12 +230,27 @@ static bool rk_aux_param_handler(struct bl_aux_param_header *param) void params_early_setup(u_register_t plat_param_from_bl2) { + int ret; + /* * Test if this is a FDT passed as a platform-specific parameter * block. */ - if (!dt_process_fdt(plat_param_from_bl2)) + ret = dt_process_fdt(plat_param_from_bl2); + if (!ret) { + return; + } else if (ret != -FDT_ERR_BADMAGIC) { + /* + * If we found an FDT but couldn't parse it (e.g. corrupt, not + * enough space), return and don't attempt to parse the param + * as something else, since we know that will also fail. All + * we're doing is setting up UART, this doesn't need to be + * fatal. + */ + WARN("%s: found FDT but could not parse: error %d\n", + __func__, ret); return; + } bl_aux_params_parse(plat_param_from_bl2, rk_aux_param_handler); } |