소스 검색

leds: lp55xx-common: fix sysfs entry leak

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>
Johan Hovold 11 년 전
부모
커밋
660216bf82
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/leds/leds-lp55xx-common.c

+ 2 - 0
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++) {
 	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);
 	}
 	}