fix: [common] Fix Coverity issue

Check fdt_getprop_by_offset() return value for NULL pointer (like all
other callers) to prevent a Coverity issue (CWE-476).

Signed-off-by: Bruno Achauer <bruno.achauer@intel.com>
This commit is contained in:
Bruno Achauer
2024-10-22 07:12:34 -07:00
committed by Guo Dong
parent 13f1f4e97d
commit 712cb1e867
@@ -557,6 +557,8 @@ static int overlay_apply_node(void *fdt, int target,
return -FDT_ERR_INTERNAL;
if (prop_len < 0)
return prop_len;
if (!prop)
return -FDT_ERR_INTERNAL;
ret = fdt_setprop(fdt, target, name, prop, prop_len);
if (ret)