Skip to content
Commit 3c2b68eb authored by Sebastian Głąb's avatar Sebastian Głąb Committed by Maureen Helm
Browse files

drivers: watchdog: wdt_nrfx.c Fix channel id check in wdt_feed()



A Bug in the watchdog driver code allows an unconfigured
WDT timer channel to be feed.

The first configured WDT timer channel has an id of zero.
At this point, data->m_allocated_channels is equal to one.
The condition of the if statement is invalid and allows
channel one to be feed.

Change the test condition from greater to greater-or-equal.
Add check if channel id is less than zero.

Signed-off-by: default avatarSebastian Głąb <sebastian.glab@nordicsemi.no>
parent 9882cf11
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment