From: Patrick McHardy Date: Sun, 22 Jul 2007 16:26:20 +0000 (+0200) Subject: [NET]: Fix gen_estimator timer removal race X-Git-Tag: v2.6.16.53-rc1~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e5e0ad360edc354c661ef2ab49d42ae964fc46f7;p=karo-tx-linux.git [NET]: Fix gen_estimator timer removal race As noticed by Jarek Poplawski , 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 Acked-by: Jarek Poplawski Signed-off-by: David S. Miller Signed-off-by: Adrian Bunk --- diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index b07c029e8219..5af93535e2aa 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<