Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 660216bf authored by Johan Hovold's avatar Johan Hovold Committed by Bryan Wu
Browse files

leds: lp55xx-common: fix sysfs entry leak



Make sure the sysfs group is removed when the LEDs are unregistered.

Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent f254bea4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
	}