]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
backlight: led_bl: Hold led_access lock when calling led_sysfs_disable()
authorHerve Codina <herve.codina@bootlin.com>
Wed, 22 Jan 2025 09:19:14 +0000 (10:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:30 +0000 (10:45 +0200)
commit1c82f5a393d8b9a5c1ea032413719862098afd4b
tree39a01f6576e8997cd3374c6fc1303d4446996768
parentc8fa7ffc1c23b889b8f12dedb6e1600f9a564878
backlight: led_bl: Hold led_access lock when calling led_sysfs_disable()

commit 276822a00db3c1061382b41e72cafc09d6a0ec30 upstream.

Lockdep detects the following issue on led-backlight removal:
  [  142.315935] ------------[ cut here ]------------
  [  142.315954] WARNING: CPU: 2 PID: 292 at drivers/leds/led-core.c:455 led_sysfs_enable+0x54/0x80
  ...
  [  142.500725] Call trace:
  [  142.503176]  led_sysfs_enable+0x54/0x80 (P)
  [  142.507370]  led_bl_remove+0x80/0xa8 [led_bl]
  [  142.511742]  platform_remove+0x30/0x58
  [  142.515501]  device_remove+0x54/0x90
  ...

Indeed, led_sysfs_enable() has to be called with the led_access
lock held.

Hold the lock when calling led_sysfs_disable().

Fixes: ae232e45acf9 ("backlight: add led-backlight driver")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20250122091914.309533-1-herve.codina@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/video/backlight/led_bl.c