From: Johan Hovold Date: Wed, 25 Jun 2014 17:08:55 +0000 (-0700) Subject: leds: lp55xx-common: fix sysfs entry leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=660216bf82e0cd65603c0935193c1f7c4aca04fb;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git leds: lp55xx-common: fix sysfs entry leak Make sure the sysfs group is removed when the LEDs are unregistered. Signed-off-by: Johan Hovold Signed-off-by: Bryan Wu --- diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 88317b4f7bf3..3fbfb31602c7 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -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); }