Skip to content

Commit

Permalink
drivers/watchdog: wwdg_stm32: Check return value of clock_control_on
Browse files Browse the repository at this point in the history
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 #33067

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
  • Loading branch information
erwango authored and nashif committed Mar 9, 2021
1 parent ddeff27 commit 7dc6b03
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/watchdog/wdt_wwdg_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,9 @@ 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);

wwdg_stm32_irq_config(dev);

return 0;
return clock_control_on(clk, (clock_control_subsys_t *) &cfg->pclken);
}

static struct wwdg_stm32_data wwdg_stm32_dev_data = {
Expand Down

0 comments on commit 7dc6b03

Please sign in to comment.