android_kernel_xiaomi_sm8350/drivers/misc
Henrique de Moraes Holschuh 24e45bbe69 thinkpad-acpi: fix LED handling on older ThinkPads
The less tested codepaths for LED handling, used on ThinkPads 570, 600e/x,
770e, 770x, A21e, A2xm/p, T20-22, X20 and maybe a few others, would write
data to kernel memory it had no business touching, for leds number 3 and
above.  If one is lucky, that illegal write would cause an OOPS, but
chances are it would silently corrupt a byte.

The problem was introduced in commit af116101, "ACPI: thinkpad-acpi: add
sysfs led class support to thinkpad leds (v3.2)".

Fix the bug by refactoring the entire code to be far more obvious on what
it wants to do.  Also do some defensive "constification".

Issue reported by Karol Lewandowski <lmctlx@gmail.com> (he's an lucky guy
and got an OOPS instead of silent corruption :-) ).

Root cause of the OOPS identified by Adrian Bunk <bunk@kernel.org>.
Thanks, Adrian!

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Tested-by: Karol Lewandowski <lmctlx@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-06-11 19:13:45 -04:00
..
hdpuftrs
ibmasm
sgi-xp
acer-wmi.c
asus-laptop.c
atmel_pwm.c
atmel_tclib.c
atmel-ssc.c
eeepc-laptop.c
eeprom_93cx6.c
enclosure.c
fujitsu-laptop.c
intel_menlow.c
ioc4.c
Kconfig
kgdbts.c
lkdtm.c
Makefile
msi-laptop.c
phantom.c
sony-laptop.c
tc1100-wmi.c
thinkpad_acpi.c thinkpad-acpi: fix LED handling on older ThinkPads 2008-06-11 19:13:45 -04:00
tifm_7xx1.c
tifm_core.c