linux/drivers/leds/flash
Krzysztof Kozlowski 12c4d55dd0 leds: flash: leds-qcom-flash: Fix registry access after re-bind
commit fab15f5736 upstream.

Driver in probe() updates each of 'reg_field' with 'reg_base':

	for (i = 0; i < REG_MAX_COUNT; i++)
		regs[i].reg += reg_base;

'reg_field' array (under variable 'regs' above) is statically allocated,
thus each re-bind would add another 'reg_base' leading to bogus
register addresses.  Constify the local 'reg_field' array and duplicate
it in probe to solve this.

Fixes: 96a2e242a5 ("leds: flash: Add driver to support flash LED module in QCOM PMICs")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250529063335.8785-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-08-20 18:30:13 +02:00
..
Kconfig leds: sy7802: Add support for Silergy SY7802 flash LED controller 2024-06-26 17:04:39 +01:00
leds-aat1290.c leds: aat1290: Use scoped device node handling to simplify error paths 2024-08-22 14:22:44 +01:00
leds-as3645a.c leds: as3645a: Use device_* to iterate over device child nodes 2024-08-22 14:48:02 +01:00
leds-ktd2692.c leds: ktd2692: Set missing timing properties 2024-12-05 14:02:10 +01:00
leds-lm3601x.c leds: lm3601x: Reset LED controller during probe 2024-08-05 15:15:27 +01:00
leds-max77693.c leds: max77693: Simplify with scoped for each OF child loop 2024-08-22 14:23:02 +01:00
leds-mt6360.c leds: flash: mt6360: Fix device_for_each_child_node() refcounting in error paths 2024-12-09 10:41:08 +01:00
leds-mt6370-flash.c leds: mt6370: Annotate struct mt6370_priv with __counted_by 2023-11-01 11:28:41 +00:00
leds-qcom-flash.c leds: flash: leds-qcom-flash: Fix registry access after re-bind 2025-08-20 18:30:13 +02:00
leds-rt4505.c leds: rt4505: Add MODULE_DESCRIPTION() 2024-06-21 11:57:13 +01:00
leds-rt8515.c leds: Convert all platform drivers to return void 2023-11-01 11:28:35 +00:00
leds-sgm3140.c leds: sgm3140: Add missing timer cleanup and flash gpio control 2024-03-07 08:48:12 +00:00
leds-sy7802.c leds: sy7802: Add support for Silergy SY7802 flash LED controller 2024-06-26 17:04:39 +01:00
Makefile leds: sy7802: Add support for Silergy SY7802 flash LED controller 2024-06-26 17:04:39 +01:00