-
Notifications
You must be signed in to change notification settings - Fork 7k
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
stm32: coverity fixes (gpio and watchdog) #33124
stm32: coverity fixes (gpio and watchdog) #33124
Conversation
f2e6999
to
74a0e10
Compare
74a0e10
to
99dc74c
Compare
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 <erwan.gouriou@linaro.org>
99dc74c
to
5224332
Compare
drivers/watchdog/wdt_wwdg_stm32.c
Outdated
|
||
wwdg_stm32_irq_config(dev); | ||
|
||
return 0; | ||
ret = clock_control_on(clk, (clock_control_subsys_t *) &cfg->pclken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: you may return directly here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
5224332
to
72c2fc1
Compare
drivers/watchdog/wdt_wwdg_stm32.c
Outdated
@@ -250,12 +250,11 @@ static int wwdg_stm32_init(const struct device *dev) | |||
{ | |||
const struct device *clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE); | |||
const struct wwdg_stm32_config *cfg = WWDG_STM32_CFG(dev); | |||
|
|||
clock_control_on(clk, (clock_control_subsys_t *) &cfg->pclken); | |||
int ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed now?
In function wwdg_stm32_init, return value of clock_control_on was not checked. This is reported as an issue by coverity (CID 219600). Fix this. Fixes zephyrproject-rtos#33067 Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
72c2fc1
to
a6cffea
Compare
Fixes: [Coverity CID :219652] Unchecked return value in drivers/gpio/gpio_stm32.c #33035
Fixes: [Coverity CID :219600] Unchecked return value in drivers/watchdog/wdt_wwdg_stm32.c #33067