leds: lp55xx-common: fix sysfs entry leak
authorJohan Hovold <johan@kernel.org>
Wed, 25 Jun 2014 17:08:55 +0000 (10:08 -0700)
committerBryan Wu <cooloney@gmail.com>
Fri, 27 Jun 2014 20:44:04 +0000 (13:44 -0700)
Make sure the sysfs group is removed when the LEDs are unregistered.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-lp55xx-common.c

index 88317b4..3fbfb31 100644 (file)
@@ -520,6 +520,8 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
 
        for (i = 0; i < chip->num_leds; i++) {
                each = led + i;
+               sysfs_remove_group(&each->cdev.dev->kobj,
+                                               &lp55xx_led_attr_group);
                led_classdev_unregister(&each->cdev);
                flush_work(&each->brightness_work);
        }