diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/led-triggers.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index df1a7c15f12d..c3734f10fdd5 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -219,9 +219,12 @@ void led_trigger_unregister(struct led_trigger *trig) { struct led_classdev *led_cdev; + if (list_empty_careful(&trig->next_trig)) + return; + /* Remove from the list of led triggers */ down_write(&triggers_list_lock); - list_del(&trig->next_trig); + list_del_init(&trig->next_trig); up_write(&triggers_list_lock); /* Remove anyone actively using this trigger */ |