aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorPriyanka Singh2020-11-02 11:38:41 +0530
committerPriyanka Jain2020-12-10 13:56:39 +0530
commit03d095e87d4b6865deae74527c9655161a891777 (patch)
tree8949900c553165cc9a9e2f2a568949e37b3b7904 /arch/arm/cpu
parent848a2efd142ab6d879b1afed0cdbfada30522fa7 (diff)
layerscape: fdt.c: Check for NULL return value from fdt_getprop()
Check for NULL return value from fdt_getprop() in fdt_fixup_remove_jr() Signed-off-by: Priyanka Singh <priyanka.singh@nxp.com> [Fixed checkpatch errors/warnings] Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/fdt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index 6d3391db3b3..3a04dce56fb 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -400,10 +400,12 @@ void fdt_fixup_remove_jr(void *blob)
while (jr_node != -FDT_ERR_NOTFOUND) {
reg = (fdt32_t *)fdt_getprop(blob, jr_node, "reg", &len);
- jr_offset = fdt_read_number(reg, addr_cells);
- if (jr_offset == used_jr) {
- fdt_del_node(blob, jr_node);
- break;
+ if (reg) {
+ jr_offset = fdt_read_number(reg, addr_cells);
+ if (jr_offset == used_jr) {
+ fdt_del_node(blob, jr_node);
+ break;
+ }
}
jr_node = fdt_node_offset_by_compatible(blob, jr_node,
"fsl,sec-v4.0-job-ring");