diff options
author | Maarten Zanders <maarten.zanders@mind.be> | 2022-10-28 12:56:43 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2022-10-28 17:12:27 +0200 |
commit | 17c13c724b143c835fe3a9109daab524dff3d06f (patch) | |
tree | 9fb8e63338d2384b371251ad00c21fd9956e559c /tools/perf/scripts/python/arm-cs-trace-disasm.py | |
parent | 5f52a8ba7e91215c3d046d298fb328d1b9f7897d (diff) |
leds: lp5523: fix out-of-bounds bug in lp5523_selftest()
When not all LED channels of the led chip are configured, the
sysfs selftest functionality gives erroneous results and tries to
test all channels of the chip.
There is a potential for LED overcurrent conditions since the
test current will be set to values from out-of-bound regions.
It is wrong to use pdata->led_config[i].led_current to skip absent
channels as led_config[] only contains the configured LED channels.
Instead of iterating over all the physical channels of the device,
loop over the available LED configurations and use led->chan_nr to
access the correct i2c registers. Keep the zero-check for the LED
current as existing users might depend on this to disable a channel.
Reported-by: Arne Staessen <a.staessen@televic.com>
Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'tools/perf/scripts/python/arm-cs-trace-disasm.py')
0 files changed, 0 insertions, 0 deletions