Description
Static code scan issues found in file:
Category: Integer handling issues
Function: icm42688_gyro_rads
Component: Drivers
CID: 394233
Details:
zephyr/drivers/sensor/tdk/icm42688/icm42688.h
Line 575 in dcf4291
569 break;
570 }
571
572 int64_t in10_rads = (int64_t)in * SENSOR_PI * 10LL;
573
574 /* Whole rad/s */
>>> CID 394233: Integer handling issues (DIVIDE_BY_ZERO)
>>> In expression "in10_rads / (sensitivity * 180LL * 1000000LL)", division by expression "sensitivity * 180LL * 1000000LL" which may be zero has undefined behavior.
575 *out_rads = in10_rads / (sensitivity * 180LL * 1000000LL);
576
577 /* microrad/s */
578 *out_urads =
579 (in10_rads - (*out_rads * sensitivity * 180LL * 1000000LL)) / (sensitivity * 180LL);
580 }
For more information about the violation, check the Coverity Reference. (CWE-369)
Please fix or provide comments in coverity using the link:
https://scan9.scan.coverity.com/#/project-view/29271/12996?selectedIssue=394233
Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the MAINTAINERS file.