Fwd: New Defects reported by Coverity Scan for RTEMS
Joel Sherrill
joel at rtems.org
Wed Aug 2 11:42:08 UTC 2023
New Coverity issue
---------- Forwarded message ---------
From: <scan-admin at coverity.com>
Date: Wed, Aug 2, 2023, 12:22 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 1539495: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/bsps/shared/dev/rtc/mcp7940m.c: 317 in mcp7940m_set_time()
________________________________________________________________________________________________________
*** CID 1539495: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/bsps/shared/dev/rtc/mcp7940m.c: 317 in mcp7940m_set_time()
311 rv = mcp7940m_i2c_read(ctx, REG_RTCSEC, buf, sizeof(buf));
312 }
313
314 if (rv == 0) {
315 /* Make sure weekday is in range. Otherwise it's not relevant.
*/
316 if (RTCWKDAY_WKDAY_GET(buf[REG_RTCWKDAY]) < 1 ||
>>> CID 1539495: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
>>> "((buf[3] & (7U /* 7U << 0U */)) >> 0U) > 7" is always false
regardless of the values of its operands. This occurs as the logical second
operand of "||".
317 RTCWKDAY_WKDAY_GET(buf[REG_RTCWKDAY]) > 7) {
318 buf[REG_RTCWKDAY] &= ~RTCWKDAY_WKDAY_MASK;
319 buf[REG_RTCWKDAY] |= RTCWKDAY_WKDAY(1);
320 }
321
322 buf[REG_RTCYEAR] &= ~RTCYEAR_YRBCD_MASK;
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit,
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQ4-2B8hpujh0hTgQljRGId4Dg-3D-3DcyWG_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMpYS-2B09LHsska0uyPzxh7uKKzrgmDf1f3-2BmDhHKIEFAROWH-2BDbWaJf1fkFUy9YO2BWhIOMEtmufkuQdoc6Ezm8QNR6E7LDB49TP6u3-2BSbC-2F41-2Fw23mpQ6qPqQmDGVCjb2ihRuh8TdBC3cxDcbTEcy5EoYr4gqciLZgtCrJFvedzgQ-3D-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/20230802/65a5da82/attachment.htm>
More information about the devel
mailing list