Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coverity CID :208407] Unsigned compared against 0 in drivers/modem/modem_pin.c #22911

Closed
zephyrbot opened this issue Feb 18, 2020 · 0 comments
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/93b78b7bf8bfad75196de969a7487f95f235aad3/drivers/modem/modem_pin.c#L41

Category: Control flow issues
Function: modem_pin_config
Component: Drivers
CID: 208407

Details:

35         return gpio_pin_set_raw(ctx->pins[pin].gpio_port_dev,
36                     ctx->pins[pin].pin, value);
37     }
38    
39     int modem_pin_config(struct modem_context *ctx, u32_t pin, bool enable)
40     {
>>>     CID 208407:  Control flow issues  (NO_EFFECT)
>>>     This less-than-zero comparison of an unsigned value is never true. "pin < 0U".
41         if (pin < 0 || pin >= ctx->pins_len) {
42             return -ENODEV;
43         }
44    
45         return gpio_pin_configure(ctx->pins[pin].gpio_port_dev,
46                       ctx->pins[pin].pin,

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

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 CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Feb 18, 2020
@jukkar jukkar closed this as completed Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants