aboutsummaryrefslogtreecommitdiffstats
path: root/net/rfkill
diff options
context:
space:
mode:
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/rfkill.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 022fe50ab0e0..fc3a4fd88995 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -590,8 +590,10 @@ static void rfkill_led_trigger_register(struct rfkill *rfkill)
590static void rfkill_led_trigger_unregister(struct rfkill *rfkill) 590static void rfkill_led_trigger_unregister(struct rfkill *rfkill)
591{ 591{
592#ifdef CONFIG_RFKILL_LEDS 592#ifdef CONFIG_RFKILL_LEDS
593 if (rfkill->led_trigger.name) 593 if (rfkill->led_trigger.name) {
594 led_trigger_unregister(&rfkill->led_trigger); 594 led_trigger_unregister(&rfkill->led_trigger);
595 rfkill->led_trigger.name = NULL;
596 }
595#endif 597#endif
596} 598}
597 599
@@ -627,8 +629,8 @@ int rfkill_register(struct rfkill *rfkill)
627 629
628 error = device_add(dev); 630 error = device_add(dev);
629 if (error) { 631 if (error) {
630 rfkill_led_trigger_unregister(rfkill);
631 rfkill_remove_switch(rfkill); 632 rfkill_remove_switch(rfkill);
633 rfkill_led_trigger_unregister(rfkill);
632 return error; 634 return error;
633 } 635 }
634 636