[RTEMS Project] #4251: b1553rt.c: Dereference before null check error spotted by Coverity
RTEMS trac
trac at rtems.org
Tue Feb 16 20:46:40 UTC 2021
#4251: b1553rt.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 1399830: Dereference before null check in rt_control().
{{{
621 rtems_libio_ioctl_args_t *ioarg = (rtems_libio_ioctl_args_t *) arg;
deref_ptr: Directly dereferencing pointer ioarg.
622 unsigned int *data = ioarg->buffer;
623
624 rt_priv *rt;
625 struct drvmgr_dev *dev;
626
627 FUNCDBG("rt_control[%d]: [%i,%i]\n", minor, major, minor);
628
629 if ( drvmgr_get_dev(&b1553rt_drv_info.general, minor, &dev) ) {
630 return RTEMS_UNSATISFIED;
631 }
632 rt = (rt_priv *)dev->priv;
633
CID 1399830 (#1 of 1): Dereference before null check
(REVERSE_INULL)check_after_deref: Null-checking ioarg suggests that it may
be null, but it has already been dereferenced on all paths leading to the
check.
634 if (!ioarg) {
}}}
--
Ticket URL: <http://devel.rtems.org/ticket/4251>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list