996523
commit 37459fd1ad1ac48a121ab0edae331090fb8e2833
996523
Author: Miroslav Lichvar <mlichvar@redhat.com>
996523
Date:   Thu Nov 20 17:30:28 2014 +0100
996523
996523
    linreg: fix servo resetting
996523
    
996523
    The stats for the maximum size were not reset, which caused the
996523
    the servo to reuse old data instead of returning with unlocked
996523
    state.
996523
    
996523
    Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
996523
996523
diff --git a/linreg.c b/linreg.c
996523
index b94c44e..fde604d 100644
996523
--- a/linreg.c
996523
+++ b/linreg.c
996523
@@ -294,7 +294,7 @@ static void linreg_reset(struct servo *servo)
996523
 	s->last_update = 0;
996523
 	s->frequency_ratio = 1.0;
996523
 
996523
-	for (i = MIN_SIZE; i < MAX_SIZE; i++) {
996523
+	for (i = MIN_SIZE; i <= MAX_SIZE; i++) {
996523
 		s->results[i - MIN_SIZE].slope = 0.0;
996523
 		s->results[i - MIN_SIZE].err_updates = 0;
996523
 	}