[RTEMS Project] #3947: fdt_rw.c: Unchecked return value (CID #1047324)

RTEMS trac trac at rtems.org
Fri Apr 10 15:33:06 UTC 2020


#3947: fdt_rw.c: Unchecked return value (CID #1047324)
----------------------------+-----------------------------
  Reporter:  Joel Sherrill  |      Owner:  Sebastian Huber
      Type:  defect         |     Status:  assigned
  Priority:  normal         |  Milestone:  5.1
 Component:  admin          |    Version:  5
  Severity:  normal         |   Keywords:
Blocked By:                 |   Blocking:
----------------------------+-----------------------------
 git blams says Sebastian.

 {{{
 *** CID 1047324:  Error handling issues  (CHECKED_RETURN)
 /home/joel/rtems-work/rtems/cpukit/dtc/libfdt/fdt_rw.c: 351 in
 fdt_add_subnode_namelen()
 345             if (offset >= 0)
 346                     return -FDT_ERR_EXISTS;
 347             else if (offset != -FDT_ERR_NOTFOUND)
 348                     return offset;
 349
 350             /* Try to place the new node after the parent's properties
 */
 >>>     CID 1047324:  Error handling issues  (CHECKED_RETURN)
 >>>     Calling "fdt_next_tag" without checking return value (as is done
 elsewhere 7 out of 8 times).
 351             fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the
 BEGIN_NODE */
 352             do {
 353                     offset = nextoffset;
 354                     tag = fdt_next_tag(fdt, offset, &nextoffset);
 355             } while ((tag == FDT_PROP) || (tag == FDT_NOP));
 356

 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3947>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list