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 :219652] Unchecked return value in drivers/gpio/gpio_stm32.c #33035

Closed
zephyrbot opened this issue Mar 7, 2021 · 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 platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https:/zephyrproject-rtos/zephyr/tree/bd97359a5338b2542d19011b6d6aa1d8d1b9cc3f/drivers/gpio/gpio_stm32.c#L367

Category: Error handling issues
Function: gpio_stm32_enable_int
Component: Drivers
CID: 219652

Details:

clock_control_on(clk, (clock_control_subsys_t *) &pclken);

361     #else
362             .bus = STM32_CLOCK_BUS_APB2,
363             .enr = LL_APB2_GRP1_PERIPH_SYSCFG
364     #endif /* CONFIG_SOC_SERIES_STM32H7X */
365         };
366         /* Enable SYSCFG clock */
>>>     CID 219652:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "clock_control_on" without checking return value (as is done elsewhere 24 out of 30 times).
367         clock_control_on(clk, (clock_control_subsys_t *) &pclken);
368     #endif
369    
370         gpio_stm32_set_exti_source(port, pin);
371    
372         return 0;

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 Mar 7, 2021
@FRASTM FRASTM added the platform: STM32 ST Micro STM32 label Mar 8, 2021
erwango added a commit to erwango/zephyr that referenced this issue Mar 8, 2021
In function gpio_stm32_enable_int, retiurn value of clock_control_on
was not checked.
This is reported as an issue by coverity (CID 219652).
Fix this.

Fixes zephyrproject-rtos#33035

Signed-off-by: Erwan Gouriou <[email protected]>
@nashif nashif closed this as completed in ddeff27 Mar 9, 2021
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 platform: STM32 ST Micro STM32 priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants