linux-kernelorg-stable/drivers/regulator
Manivannan Sadhasivam c9764fd88b
regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods
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>
2025-07-03 12:22:35 +01:00
..
88pg86x.c
88pm800-regulator.c
88pm886-regulator.c
88pm8607.c
Kconfig regulator: tps65219: Add TI TPS65214 Regulator Support 2025-05-02 05:39:06 +09:00
Makefile regulator: adp5055: Add driver for adp5055 2025-04-09 13:47:22 +01:00
aat2870-regulator.c
ab8500-ext.c
ab8500.c
act8865-regulator.c
act8945a-regulator.c
ad5398.c regulator: ad5398: Fix incorrect power down bit mask 2025-02-06 11:27:24 +00:00
adp5055-regulator.c regulator: adp5055: Remove unneeded semicolon 2025-04-14 11:22:40 +01:00
anatop-regulator.c
arizona-ldo1.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
arizona-micsupp.c
as3711-regulator.c
as3722-regulator.c
atc260x-regulator.c
aw37503-regulator.c
axp20x-regulator.c regulator: axp20x: AXP717: dcdc4 doesn't have delay 2025-03-19 12:28:26 +00:00
bcm590xx-regulator.c regulator: bcm590xx: Add support for BCM59054 regulators 2025-05-22 10:57:46 +01:00
bd718x7-regulator.c
bd9571mwv-regulator.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
bd9576-regulator.c
bd71815-regulator.c
bd71828-regulator.c
bd96801-regulator.c regulator: bd96801: Support ROHM BD96806 PMIC 2025-04-24 14:53:18 +01:00
core.c regulator: core: fix NULL dereference on unbind due to stale coupling data 2025-06-29 22:10:41 +01:00
cpcap-regulator.c
cros-ec-regulator.c regulator: cros-ec: use devm_kmemdup_array() 2025-02-28 14:01:07 +00:00
da903x-regulator.c
da9052-regulator.c
da9055-regulator.c
da9062-regulator.c
da9063-regulator.c
da9121-regulator.c regulator: da9121: Fix Wvoid-pointer-to-enum-cast warning 2025-05-10 23:58:04 +09:00
da9121-regulator.h
da9210-regulator.c
da9210-regulator.h
da9211-regulator.c
da9211-regulator.h
db8500-prcmu.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
dbx500-prcmu.c
dbx500-prcmu.h
devres.c Convert regulator drivers to use 2025-02-28 16:33:32 +00:00
dummy.c regulator: dummy: convert to use the faux device interface 2025-03-14 09:10:29 +01:00
dummy.h
event.c
fan53555.c regulator: fan53555: add enable_time support and soft-start times 2025-06-16 13:26:23 +01:00
fan53880.c
fixed-helper.c
fixed.c
gpio-regulator.c regulator: gpio: Fix the out-of-bounds access to drvdata::gpiods 2025-07-03 12:22:35 +01:00
helpers.c
hi655x-regulator.c
hi6421-regulator.c
hi6421v530-regulator.c
hi6421v600-regulator.c
internal.h
irq_helpers.c regulator: allow user configuration of hardware protection action 2025-03-16 23:24:14 -07:00
isl6271a-regulator.c
isl9305.c
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
max1586.c
max5970-regulator.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-05-26 14:01:29 +01:00
max20086-regulator.c regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt() 2025-06-08 23:29:48 +01:00
max20411-regulator.c
max77503-regulator.c
max77541-regulator.c
max77620-regulator.c
max77650-regulator.c
max77686-regulator.c
max77693-regulator.c
max77802-regulator.c
max77826-regulator.c
max77857-regulator.c
mc13xxx-regulator-core.c
mc13xxx.h
mc13783-regulator.c
mc13892-regulator.c
mcp16502.c
mp886x.c regulator: mp886x: Fix ID table driver_data 2025-06-30 16:06:40 +01:00
mp5416.c
mp8859.c
mpq7920.c
mpq7920.h
mt6311-regulator.c
mt6311-regulator.h
mt6315-regulator.c
mt6323-regulator.c
mt6331-regulator.c
mt6332-regulator.c
mt6357-regulator.c
mt6358-regulator.c
mt6359-regulator.c
mt6360-regulator.c
mt6370-regulator.c
mt6380-regulator.c
mt6397-regulator.c
mtk-dvfsrc-regulator.c
of_regulator.c regulator: Add (devm_)of_regulator_get() 2025-02-24 15:26:08 +00:00
palmas-regulator.c
pbias-regulator.c
pca9450-regulator.c regulator: pca9450: Add restart handler 2025-05-12 21:09:50 +09:00
pcap-regulator.c
pf8x00-regulator.c
pf9453-regulator.c regulator: pf9453: convert to use maple tree register cache 2025-04-24 12:56:29 +01:00
pfuze100-regulator.c
pv88060-regulator.c
pv88060-regulator.h
pv88080-regulator.c
pv88080-regulator.h
pv88090-regulator.c
pv88090-regulator.h
pwm-regulator.c
qcom-labibb-regulator.c
qcom-pm8008-regulator.c
qcom-refgen-regulator.c
qcom-rpmh-regulator.c regulator: qcom-rpmh: Update ranges for FTSMPS525 2024-11-18 15:44:30 +00:00
qcom_rpm-regulator.c
qcom_smd-regulator.c
qcom_spmi-regulator.c regulator: qcom_spmi: Constify struct spmi_voltage_range 2025-05-19 11:41:48 +01:00
qcom_usb_vbus-regulator.c
raa215300.c
rc5t583-regulator.c
regnl.h
renesas-usb-vbus-regulator.c
rk808-regulator.c objtool, regulator: rk808: Remove potential undefined behavior in rk806_set_mode_dcdc() 2025-03-25 23:00:29 +01:00
rn5t618-regulator.c
rohm-regulator.c
rpi-panel-attiny-regulator.c regulator: rpi-panel-attiny: use new GPIO line value setter callbacks 2025-04-08 12:05:42 +01:00
rt4801-regulator.c
rt4803.c
rt4831-regulator.c
rt5033-regulator.c
rt5120-regulator.c
rt5190a-regulator.c
rt5739.c
rt5759-regulator.c
rt6160-regulator.c
rt6190-regulator.c
rt6245-regulator.c
rtmv20-regulator.c
rtq2134-regulator.c
rtq2208-regulator.c regulator: rtq2208: Fix the LDO DVS capability 2025-03-17 12:45:37 +00:00
rtq6752-regulator.c regulator: rtq6752: make const read-only array fault_mask static 2025-03-17 17:35:52 +00:00
s2mpa01.c
s2mps11.c regulator: s2mps11: Add support for S2MPU05 regulators 2025-03-13 12:38:52 +00:00
s5m8767.c regulator: s5m8767: Convert to GPIO descriptors 2025-04-07 12:53:34 +01:00
sc2731-regulator.c
scmi-regulator.c
sky81452-regulator.c
slg51000-regulator.c
slg51000-regulator.h
stm32-booster.c
stm32-pwr.c
stm32-vrefbuf.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
stpmic1_regulator.c
stw481x-vmmc.c
sun20i-regulator.c
sy7636a-regulator.c
sy8106a-regulator.c
sy8824x.c regulator: sy8824x: Fix ID table driver_data 2025-06-30 16:06:39 +01:00
sy8827n.c
ti-abb-regulator.c
tps6105x-regulator.c
tps6286x-regulator.c
tps6287x-regulator.c regulator: TPS6287X: Use min/max uV to get VRANGE 2025-01-21 15:21:56 +00:00
tps6507x-regulator.c
tps6524x-regulator.c
tps6586x-regulator.c
tps6594-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
tps65219-regulator.c regulator: tps65219: Fix devm_kmalloc size allocation 2025-06-29 22:10:41 +01:00
tps65910-regulator.c
tps65912-regulator.c
tps68470-regulator.c
twl-regulator.c
twl6030-regulator.c
uniphier-regulator.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
userspace-consumer.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
vctrl-regulator.c
vexpress-regulator.c
virtual.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
vqmmc-ipq4019-regulator.c
wm831x-dcdc.c
wm831x-isink.c
wm831x-ldo.c
wm8350-regulator.c regulator: Switch back to struct platform_driver::remove() 2024-11-12 13:08:35 +00:00
wm8400-regulator.c
wm8994-regulator.c