提交 660216bf 编写于 作者: J Johan Hovold 提交者: Bryan Wu

leds: lp55xx-common: fix sysfs entry leak

Make sure the sysfs group is removed when the LEDs are unregistered.
Signed-off-by: NJohan Hovold <johan@kernel.org>
Signed-off-by: NBryan Wu <cooloney@gmail.com>
上级 f254bea4
...@@ -520,6 +520,8 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip) ...@@ -520,6 +520,8 @@ void lp55xx_unregister_leds(struct lp55xx_led *led, struct lp55xx_chip *chip)
for (i = 0; i < chip->num_leds; i++) { for (i = 0; i < chip->num_leds; i++) {
each = led + i; each = led + i;
sysfs_remove_group(&each->cdev.dev->kobj,
&lp55xx_led_attr_group);
led_classdev_unregister(&each->cdev); led_classdev_unregister(&each->cdev);
flush_work(&each->brightness_work); flush_work(&each->brightness_work);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册