From: Patrick McHardy Date: Wed, 18 Jul 2007 09:48:43 +0000 (-0700) Subject: gen estimator timer unload race X-Git-Tag: v2.6.22.2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e9d3cf88b10374bc7a863f4ad9906245d29d2b3;p=thirdparty%2Fkernel%2Fstable.git gen estimator timer unload race [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: Greg Kroah-Hartman --- diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 17daf4c9f7938..cc84d8d8a3c7d 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<