[PATCH 1/3] fdt_rw.c: Fix Unchecked return value (CID #1047324)

Ryan Long thisisryanlong at gmail.com
Mon Mar 1 16:23:59 UTC 2021


CID 1047324: Unchecked return value in fdt_add_subnode_namelen().

Updates #4256
---
 cpukit/dtc/libfdt/fdt_rw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cpukit/dtc/libfdt/fdt_rw.c b/cpukit/dtc/libfdt/fdt_rw.c
index 1385425..d6f7d93 100644
--- a/cpukit/dtc/libfdt/fdt_rw.c
+++ b/cpukit/dtc/libfdt/fdt_rw.c
@@ -348,7 +348,11 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
 		return offset;
 
 	/* Try to place the new node after the parent's properties */
-	fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+        #ifdef __rtems__
+	  (void)fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
+        #else
+          fdt_next_tag(fdt, parentoffset, &nextoffset);
+        #endif
 	do {
 		offset = nextoffset;
 		tag = fdt_next_tag(fdt, offset, &nextoffset);
-- 
1.8.3.1



More information about the devel mailing list