diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-18 02:48:43 -0700 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2007-08-25 17:23:58 +0200 |
commit | 6bfc898d23fd41cc7fc1e8d0bc6a106f0e62d2ff (patch) | |
tree | f9f7e59cbf83f95737821d75e510090e0c556f18 /net | |
parent | 844aa7759d867d26c4a63610c0da2354e235d80a (diff) |
[PATCH] gen estimator timer unload race
[NET]: Fix gen_estimator timer removal race
As noticed by Jarek Poplawski <jarkao2@o2.pl>, the timer removal in
gen_kill_estimator races with the timer function rearming the timer.
Check whether the timer list is empty before rearming the timer
in the timer function to fix this.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jarek Poplawski <jarkao2@o2.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/gen_estimator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 3cad026764f0..33d82bfa3190 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -128,7 +128,8 @@ static void est_timer(unsigned long arg) spin_unlock(e->stats_lock); } - mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); + if (elist[idx].list != NULL) + mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); read_unlock(&est_lock); } |