Fwd: New Defects reported by Coverity Scan for RTEMS

Joel Sherrill joel at rtems.org
Fri Mar 12 13:31:38 UTC 2021


Luckily I think it is an easy one. Checking if an unsigned value is less
than 0.

Look back in the history. Ryan may have fixed it once and you just
accidentally
reverted it. He fixed a handful like this.

I'm sorry you were the first to be caught by it but I am thrilled to have
Coverity
run automatically about midnight Central time every night if there were any
changes to the RSB or RTEMS repos. Then it sends an email to build@ if
any new issues turned up. Definitely progress has been made here.

--joel

On Fri, Mar 12, 2021 at 7:22 AM Daniel Hellstrom <daniel at gaisler.com> wrote:

> yes, it must have, so I will look into that.
>
> /Daniel
>
>        On 2021-03-12 14:07, Joel Sherrill wrote:
>
> Without looking, I would assume this was introduced by Daniel's recent
> patches.
>
> ---------- Forwarded message ---------
> From: <scan-admin at coverity.com>
> Date: Fri, Mar 12, 2021, 12:55 AM
> Subject: New Defects reported by Coverity Scan for RTEMS
> To: <build at rtems.org>
>
>
> Hi,
>
> Please find the latest report on new defect(s) introduced to RTEMS found
> with Coverity Scan.
>
> 1 new defect(s) introduced to RTEMS found with Coverity Scan.
>
>
> New defect(s) Reported-by: Coverity Scan
> Showing 1 of 1 defect(s)
>
>
> ** CID 1473629:  Control flow issues  (NO_EFFECT)
> /bsps/shared/grlib/can/grcanfd.c: 323 in grcan_hw_write_try_fd()
>
>
>
> ________________________________________________________________________________________________________
> *** CID 1473629:  Control flow issues  (NO_EFFECT)
> /bsps/shared/grlib/can/grcanfd.c: 323 in grcan_hw_write_try_fd()
> 317                             bds = 1;
> 318                     if (space_left < bds)
> 319                             break;
> 320
> 321                     /* Convert and write CAN message to DMA buffer */
> 322                     dlc = grcan_len2dlc(source->len);
> >>>     CID 1473629:  Control flow issues  (NO_EFFECT)
> >>>     This less-than-zero comparison of an unsigned value is never true.
> "dlc < 0".
> 323                     if (dlc < 0) {
> 324                             /* Bad user input. Report the number of
> written messages
> 325                              * or an error when non sent.
> 326                              */
> 327                             if (ret <= 0)
> 328                                     return GRCAN_RET_INVARG;
>
>
>
> ________________________________________________________________________________________________________
> To view the defects in Coverity Scan visit,
> https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DVX3j_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMppdCoTOdWUHKtQLrEQ1MfSyaNP2M1HWoDjjoKTjy-2FIq1HdvVcL1npIuQDJWa-2FDWEQ-2FAOQo8VzAxUCWwGfT9lbXVNqnU0jQl-2FWSYNQAJPY2Tylmw5hG5KcV6hC39VfLDFtSor5xgUxBh-2BcdibW34mNQFj7qSSTl6hW9DF4ywtf1oYStmZyjbwIV0D1AeB2dPto-3D
>
> _______________________________________________
> build mailing list
> build at rtems.org
> http://lists.rtems.org/mailman/listinfo/build
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210312/a8314218/attachment-0001.html>


More information about the devel mailing list