linux-yocto/drivers/regulator
Manivannan Sadhasivam 56738cbac3 regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods
[ Upstream commit c9764fd88b ]

drvdata::gpiods is supposed to hold an array of 'gpio_desc' pointers. But
the memory is allocated for only one pointer. This will lead to
out-of-bounds access later in the code if 'config::ngpios' is > 1. So
fix the code to allocate enough memory to hold 'config::ngpios' of GPIO
descriptors.

While at it, also move the check for memory allocation failure to be below
the allocation to make it more readable.

Cc: stable@vger.kernel.org # 5.0
Fixes: d6cd33ad71 ("regulator: gpio: Convert to use descriptors")
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20250703103549.16558-1-mani@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-07-10 15:57:48 +02:00
..
88pg86x.c
88pm800-regulator.c
88pm8607.c
aat2870-regulator.c
ab8500-ext.c
ab8500.c
act8865-regulator.c
act8945a-regulator.c
ad5398.c regulator: ad5398: Add device tree support 2025-06-04 14:38:04 +02:00
anatop-regulator.c
arizona-ldo1.c
arizona-micsupp.c
as3711-regulator.c
as3722-regulator.c
atc260x-regulator.c
axp20x-regulator.c
bcm590xx-regulator.c
bd718x7-regulator.c
bd9571mwv-regulator.c
bd9576-regulator.c
bd71815-regulator.c regulator: bd71815: fix ramp values 2024-07-05 09:14:33 +02:00
bd71828-regulator.c regulator: bd71828: Don't overwrite runtime voltages 2024-06-16 13:39:46 +02:00
core.c regulator: check that dummy regulator has been probed before using it 2025-04-10 14:31:54 +02:00
cpcap-regulator.c
cros-ec-regulator.c
da903x-regulator.c
da9052-regulator.c
da9055-regulator.c
da9062-regulator.c
da9063-regulator.c
da9121-regulator.c
da9121-regulator.h
da9210-regulator.c
da9210-regulator.h
da9211-regulator.c regulator: da9211: Use irq handler when ready 2023-01-18 11:48:53 +01:00
da9211-regulator.h
db8500-prcmu.c
dbx500-prcmu.c
dbx500-prcmu.h
devres.c
dummy.c
dummy.h
fan53555.c regulator: fan53555: Fix wrong TCS_SLEW_MASK 2023-04-26 13:51:47 +02:00
fan53880.c
fixed-helper.c
fixed.c regulator: Handle deferred clk 2023-04-05 11:24:55 +02:00
gpio-regulator.c regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods 2025-07-10 15:57:48 +02:00
helpers.c
hi655x-regulator.c
hi6421-regulator.c
hi6421v530-regulator.c
hi6421v600-regulator.c
internal.h
irq_helpers.c regulator: irq_helpers: duplicate IRQ name 2024-06-16 13:39:14 +02:00
isl6271a-regulator.c
isl9305.c
Kconfig
lm363x-regulator.c
lochnagar-regulator.c
lp872x.c
lp873x-regulator.c
lp3971.c
lp3972.c
lp8755.c
lp8788-buck.c
lp8788-ldo.c
lp87565-regulator.c
ltc3589.c
ltc3676.c
Makefile
max1586.c
max8649.c
max8660.c
max8893.c
max8907-regulator.c
max8925-regulator.c
max8952.c
max8973-regulator.c
max8997-regulator.c
max8998.c
max14577-regulator.c regulator: max14577: Add error check for max14577_read_reg() 2025-06-27 11:05:27 +01:00
max77620-regulator.c
max77650-regulator.c
max77686-regulator.c
max77693-regulator.c
max77802-regulator.c regulator: max77802: Bounds check regulator id against opmode 2023-03-10 09:39:53 +01:00
max77826-regulator.c
mc13xxx-regulator-core.c
mc13xxx.h
mc13783-regulator.c
mc13892-regulator.c
mcp16502.c
mp886x.c
mp5416.c
mp8859.c
mpq7920.c
mpq7920.h
mt6311-regulator.c
mt6311-regulator.h
mt6315-regulator.c
mt6323-regulator.c
mt6358-regulator.c
mt6359-regulator.c regulator: mt6359: add read check for PMIC MT6359 2023-05-30 13:55:33 +01:00
mt6360-regulator.c regulator: mt6360: De-capitalize devicetree regulator subnodes 2024-05-17 11:50:46 +02:00
mt6380-regulator.c
mt6397-regulator.c
mtk-dvfsrc-regulator.c
of_regulator.c regulator: of: Implement the unwind path of of_regulator_match() 2025-03-13 12:49:57 +01:00
palmas-regulator.c
pbias-regulator.c
pca9450-regulator.c regulator: pca9450: Fix BUCK2 enable_mask 2023-05-30 13:55:32 +01:00
pcap-regulator.c
pcf50633-regulator.c
pf8x00-regulator.c
pfuze100-regulator.c regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe() 2022-09-23 14:15:50 +02:00
pv88060-regulator.c
pv88060-regulator.h
pv88080-regulator.c
pv88080-regulator.h
pv88090-regulator.c
pv88090-regulator.h
pwm-regulator.c regulator: pwm-regulator: Add validity checks in continuous .get_voltage 2024-03-01 13:21:45 +01:00
qcom_rpm-regulator.c regulator: qcom_rpm: Fix circular deferral regression 2022-10-26 12:34:21 +02:00
qcom_smd-regulator.c
qcom_spmi-regulator.c
qcom_usb_vbus-regulator.c
qcom-labibb-regulator.c regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe() 2022-12-31 13:14:17 +01:00
qcom-rpmh-regulator.c regulator: qcom-rpmh: Fix PMR735a S3 regulator spec 2022-12-31 13:14:10 +01:00
rc5t583-regulator.c
rk808-regulator.c regulator: rk808: Add apply_bit for BUCK3 on RK809 2024-12-14 19:50:40 +01:00
rn5t618-regulator.c
rohm-regulator.c
rpi-panel-attiny-regulator.c
rt4801-regulator.c
rt4831-regulator.c
rt5033-regulator.c
rt6160-regulator.c
rt6245-regulator.c
rtmv20-regulator.c
rtq2134-regulator.c
rtq6752-regulator.c
s2mpa01.c
s2mps11.c
s5m8767.c regulator: s5m8767: Bounds check id indexing into arrays 2023-03-10 09:39:53 +01:00
sc2731-regulator.c
scmi-regulator.c
sky81452-regulator.c
slg51000-regulator.c regulator: slg51000: Wait after asserting CS pin 2022-12-14 11:37:16 +01:00
slg51000-regulator.h
stm32-booster.c
stm32-pwr.c regulator: stm32-pwr: fix of_iomap leak 2023-05-11 23:00:24 +09:00
stm32-vrefbuf.c
stpmic1_regulator.c
stw481x-vmmc.c
sy7636a-regulator.c
sy8106a-regulator.c
sy8824x.c
sy8827n.c
ti-abb-regulator.c
tps6105x-regulator.c
tps6507x-regulator.c
tps6524x-regulator.c
tps6586x-regulator.c
tps51632-regulator.c
tps62360-regulator.c
tps65023-regulator.c
tps65086-regulator.c
tps65090-regulator.c
tps65132-regulator.c
tps65217-regulator.c
tps65218-regulator.c
tps65910-regulator.c
tps65912-regulator.c
tps80031-regulator.c
twl-regulator.c
twl6030-regulator.c regulator: twl6030: fix get status of twl6032 regulators 2022-12-14 11:37:16 +01:00
uniphier-regulator.c
userspace-consumer.c
vctrl-regulator.c
vexpress-regulator.c
virtual.c
vqmmc-ipq4019-regulator.c regulator: vqmmc-ipq4019: fix module autoloading 2024-06-16 13:39:14 +02:00
wm831x-dcdc.c
wm831x-isink.c
wm831x-ldo.c
wm8350-regulator.c
wm8400-regulator.c
wm8994-regulator.c