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 drivers: use non-racy method for proc entries creation (2) 2008-04-29 08:06:22 -07:00
ibmasm drivers/misc: replace remaining __FUNCTION__ occurrences 2008-04-29 08:06:03 -07:00
sgi-xp drivers/misc/sgi-xp: replace partid_t with a short 2008-05-13 08:02:23 -07:00
acer-wmi.c
asus-laptop.c
atmel_pwm.c
atmel_tclib.c
atmel-ssc.c
eeepc-laptop.c eeepc-laptop: add hwmon fan control 2008-04-29 10:08:07 -04:00
eeprom_93cx6.c
enclosure.c
fujitsu-laptop.c fujitsu-laptop: autoload module on Lifebook P1510D 2008-06-06 11:29:09 -07:00
intel_menlow.c intel_menlo: fix build warning 2008-04-29 12:24:24 -04:00
ioc4.c drivers/misc: replace remaining __FUNCTION__ occurrences 2008-04-29 08:06:03 -07:00
Kconfig Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release 2008-04-30 13:58:00 -04:00
kgdbts.c kgdbts: Use HW breakpoints with CONFIG_DEBUG_RODATA 2008-05-28 12:49:57 -05:00
lkdtm.c
Makefile
msi-laptop.c
phantom.c Misc, phantom, fix poll 2008-04-29 08:06:02 -07:00
sony-laptop.c drivers/misc: replace remaining __FUNCTION__ occurrences 2008-04-29 08:06:03 -07:00
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