[RTEMS Project] #4253: grspw_pkt.c: Dereference before null check error spotted by Coverity

RTEMS trac trac at rtems.org
Tue Feb 16 20:54:52 UTC 2021


#4253: grspw_pkt.c: Dereference before null check error spotted by Coverity
------------------------+--------------------
  Reporter:  Ryan Long  |      Owner:  (none)
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:  6.1
 Component:  bsps       |    Version:  6
  Severity:  normal     |   Keywords:
Blocked By:             |   Blocking:
------------------------+--------------------
 CID 1399846: Dereference before null check in grspw_addr_ctrl().

 {{{
 657        struct grspw_priv *priv = d;
    deref_ptr: Directly dereferencing pointer priv.
 658        struct grspw_regs *regs = priv->regs;
 659        unsigned int ctrl, nodeaddr;
 660        SPIN_IRQFLAGS(irqflags);
 661        int i;
 662
    CID 1399846 (#1 of 1): Dereference before null check
 (REVERSE_INULL)check_after_deref: Null-checking priv suggests that it may
 be null, but it has already been dereferenced on all paths leading to the
 check.
 663        if (!priv || !cfg)
 }}}

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


More information about the bugs mailing list