summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/rtems-fdt/rtems-fdt.c
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2022-09-20 10:24:59 -0500
committerJoel Sherrill <joel@rtems.org>2022-10-03 13:24:46 -0500
commit584f5bc9afa6ae293cfed58d02aab4ba3c23caa5 (patch)
treeec6f3897234c58049c15252f2e996535807eceb3 /cpukit/libmisc/rtems-fdt/rtems-fdt.c
parentrtems: Fix format (diff)
downloadrtems-584f5bc9afa6ae293cfed58d02aab4ba3c23caa5.tar.bz2
cpukit/fdt: Check correct allocation
The second allocation check was mistakenly rechecking the first allocation. It now checks the correct allocation and ensures that names is not NULL. Updates #4462
Diffstat (limited to '')
-rw-r--r--cpukit/libmisc/rtems-fdt/rtems-fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/libmisc/rtems-fdt/rtems-fdt.c b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
index 7dd2bc1047..1d3b82ae29 100644
--- a/cpukit/libmisc/rtems-fdt/rtems-fdt.c
+++ b/cpukit/libmisc/rtems-fdt/rtems-fdt.c
@@ -182,7 +182,7 @@ rtems_fdt_init_index (rtems_fdt_handle* fdt, rtems_fdt_blob* blob)
}
names = calloc(1, total_name_memory);
- if (!entries)
+ if (!names)
{
free(entries);
return -RTEMS_FDT_ERR_NO_MEMORY;