diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-20 21:47:12 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-21 08:40:29 +0100 |
commit | 2cc001a15a86b123044369845929d5dee3e4c9bb (patch) | |
tree | 9c2490f95874fdbf3fe1e8f3167fa954b9957965 /cpukit | |
parent | doc: SMP status of RTEMS 4.11 (diff) | |
download | rtems-2cc001a15a86b123044369845929d5dee3e4c9bb.tar.bz2 |
score: Fix watchdog removal
Under certain conditions a new watchdog was inserted with a wrong and
very large delta interval due to an incomplete iterator update.
Bug was introduced by 1ccbd052910ed16131c74b0d5595c8a94066942d.
Close #2501.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/score/src/watchdogremove.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/score/src/watchdogremove.c b/cpukit/score/src/watchdogremove.c index 03c0c5f0fe..2aa72a4e75 100644 --- a/cpukit/score/src/watchdogremove.c +++ b/cpukit/score/src/watchdogremove.c @@ -61,7 +61,16 @@ static void _Watchdog_Remove_it( } if ( iterator->current == &the_watchdog->Node ) { - iterator->current = _Chain_Previous( &the_watchdog->Node ); + Chain_Node *previous = _Chain_Previous( &the_watchdog->Node ); + + iterator->current = previous; + + if ( previous != _Chain_Head( &header->Watchdogs ) ) { + Watchdog_Control *previous_watchdog; + + previous_watchdog = (Watchdog_Control *) previous; + iterator->delta_interval += previous_watchdog->delta_interval; + } } iterator_node = _Chain_Next( iterator_node ); |