]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/netfilter/xt_LED.c
netfilter: x_tables: fix missing timer initialization in xt_LED
[linux.git] / net / netfilter / xt_LED.c
index 4472424e7ead93066dc7d368c0433cdc7dba17ed..19846445504dcab1ada188224c4de67139df8dc6 100644 (file)
@@ -140,9 +140,10 @@ static int led_tg_check(const struct xt_tgchk_param *par)
                goto exit_alloc;
        }
 
-       /* See if we need to set up a timer */
-       if (ledinfo->delay > 0)
-               timer_setup(&ledinternal->timer, led_timeout_callback, 0);
+       /* Since the letinternal timer can be shared between multiple targets,
+        * always set it up, even if the current target does not need it
+        */
+       timer_setup(&ledinternal->timer, led_timeout_callback, 0);
 
        list_add_tail(&ledinternal->list, &xt_led_triggers);
 
@@ -179,8 +180,7 @@ static void led_tg_destroy(const struct xt_tgdtor_param *par)
 
        list_del(&ledinternal->list);
 
-       if (ledinfo->delay > 0)
-               del_timer_sync(&ledinternal->timer);
+       del_timer_sync(&ledinternal->timer);
 
        led_trigger_unregister(&ledinternal->netfilter_led_trigger);