linux-stable/drivers/regulator
YAN SHI c091bb49b3 regulator: stm32-pwr: fix of_iomap leak
[ Upstream commit c4a413e56d ]

Smatch reports:
drivers/regulator/stm32-pwr.c:166 stm32_pwr_regulator_probe() warn:
'base' from of_iomap() not released on lines: 151,166.

In stm32_pwr_regulator_probe(), base is not released
when devm_kzalloc() fails to allocate memory or
devm_regulator_register() fails to register a new regulator device,
which may cause a leak.

To fix this issue, replace of_iomap() with
devm_platform_ioremap_resource(). devm_platform_ioremap_resource()
is a specialized function for platform devices.
It allows 'base' to be automatically released whether the probe
function succeeds or fails.

Besides, use IS_ERR(base) instead of !base
as the return value of devm_platform_ioremap_resource()
can either be a pointer to the remapped memory or
an ERR_PTR() encoded error code if the operation fails.

Fixes: dc62f951a6 ("regulator: stm32-pwr: Fix return value check in stm32_pwr_regulator_probe()")
Signed-off-by: YAN SHI <m202071378@hust.edu.cn>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304111750.o2643eJN-lkp@intel.com/
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230412033529.18890-1-m202071378@hust.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-11 23:11:06 +09:00
..
88pg86x.c
88pm800-regulator.c
88pm8607.c
Kconfig regulator: add mt6357 regulator 2022-12-02 12:23:19 +00:00
Makefile regulator: add mt6357 regulator 2022-12-02 12:23:19 +00:00
aat2870-regulator.c
ab8500-ext.c
ab8500.c
act8865-regulator.c regulator: act8865-regulator: Convert to i2c's .probe_new() 2022-11-24 13:54:00 +00:00
act8945a-regulator.c
ad5398.c regulator: ad5398: Convert to i2c's .probe_new() 2022-11-23 14:17:40 +00:00
anatop-regulator.c
arizona-ldo1.c
arizona-micsupp.c regulator: arizona-micsupp: Don't use a common regulator name 2022-11-22 17:05:04 +00:00
as3711-regulator.c
as3722-regulator.c
atc260x-regulator.c regulator: atc260x: Fix missing active_discharge_on setting 2022-04-04 08:59:43 +01:00
axp20x-regulator.c
bcm590xx-regulator.c
bd718x7-regulator.c regulator: bd718x7: Use dev_err_probe() 2022-11-23 13:09:06 +00:00
bd9571mwv-regulator.c
bd9576-regulator.c regulator: bd71815: bd71828: bd9576: Use dev_err_probe() 2022-11-23 13:09:05 +00:00
bd71815-regulator.c regulator: bd71815: bd71828: bd9576: Use dev_err_probe() 2022-11-23 13:09:05 +00:00
bd71828-regulator.c regulator: bd71815: bd71828: bd9576: Use dev_err_probe() 2022-11-23 13:09:05 +00:00
core.c regulator: core: Avoid lockdep reports when resolving supplies 2023-05-11 23:11:03 +09:00
cpcap-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
cros-ec-regulator.c platform/chrome: cros_ec_proto: Rename cros_ec_command function 2022-06-08 08:14:53 +00:00
da903x-regulator.c
da9052-regulator.c
da9055-regulator.c
da9062-regulator.c
da9063-regulator.c
da9121-regulator.c regulator: da9121-regulator: Convert to i2c's .probe_new() 2022-11-22 19:37:23 +00:00
da9121-regulator.h regulator: da9121: Add DA914x support 2021-11-30 13:08:18 +00:00
da9210-regulator.c
da9210-regulator.h
da9211-regulator.c regulator: da9211: Use irq handler when ready 2022-11-28 16:54:36 +00:00
da9211-regulator.h
db8500-prcmu.c
dbx500-prcmu.c
dbx500-prcmu.h
devres.c regulator: core: Use different devices for resource allocation and DT lookup 2022-12-08 13:02:37 +00:00
dummy.c
dummy.h
fan53555.c regulator: fan53555: Fix wrong TCS_SLEW_MASK 2023-04-26 14:29:56 +02:00
fan53880.c regulator: Drop obsolete dependencies on COMPILE_TEST 2022-11-24 16:30:19 +00:00
fixed-helper.c
fixed.c regulator: Handle deferred clk 2023-04-06 12:12:35 +02:00
gpio-regulator.c regulator: gpio: Add input_supply support in gpio_regulator_config 2022-09-29 15:20:14 +01:00
helpers.c
hi655x-regulator.c
hi6421-regulator.c
hi6421v530-regulator.c
hi6421v600-regulator.c
internal.h regulator: devres: Add devm_regulator_bulk_get_exclusive() 2022-11-03 13:34:53 +00:00
irq_helpers.c regulator: irq_helper: Provide helper for trivial IRQ notifications 2021-11-24 12:57:30 +00:00
isl6271a-regulator.c regulator: isl6271a-regulator: Convert to i2c's .probe_new() 2022-11-24 13:54:03 +00:00
isl9305.c
lm363x-regulator.c
lochnagar-regulator.c
lp872x.c regulator: lp872x: Convert to i2c's .probe_new() 2022-11-23 14:17:41 +00:00
lp873x-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE 2022-06-10 14:51:36 +02:00
lp3971.c
lp3972.c regulator: lp3972: Convert to i2c's .probe_new() 2022-11-22 19:37:25 +00:00
lp8755.c regulator: lp8755: Convert to i2c's .probe_new() 2022-11-22 19:37:25 +00:00
lp8788-buck.c
lp8788-ldo.c
lp87565-regulator.c
ltc3589.c regulator: ltc3589: Convert to i2c's .probe_new() 2022-11-23 14:17:42 +00:00
ltc3676.c
max597x-regulator.c regulator: max597x: Remove the unneeded result variable 2022-08-24 12:21:30 +01:00
max1586.c regulator: max1586: Convert to i2c's .probe_new() 2022-11-22 19:37:26 +00:00
max8649.c regulator: max8649: Convert to i2c's .probe_new() 2022-11-22 19:37:27 +00:00
max8660.c regulator: max8660: Convert to i2c's .probe_new() 2022-11-23 14:17:43 +00:00
max8893.c
max8907-regulator.c
max8925-regulator.c
max8952.c regulator: max8952: Convert to i2c's .probe_new() 2022-11-22 19:37:28 +00:00
max8973-regulator.c regulator: max8973-regulator: Convert to i2c's .probe_new() 2022-11-23 14:17:44 +00:00
max8997-regulator.c
max8998.c
max14577-regulator.c
max20086-regulator.c regulator: MAX20086: add gpio/consumer.h 2022-01-19 16:47:39 +00: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:29:18 +01:00
max77826-regulator.c
mc13xxx-regulator-core.c
mc13xxx.h
mc13783-regulator.c
mc13892-regulator.c
mcp16502.c
mp886x.c regulator: Drop obsolete dependencies on COMPILE_TEST 2022-11-24 16:30:19 +00:00
mp5416.c regulator: mp5416: remove kernel.h include 2022-06-07 17:21:36 +01:00
mp8859.c
mpq7920.c
mpq7920.h
mt6311-regulator.c
mt6311-regulator.h
mt6315-regulator.c
mt6323-regulator.c
mt6331-regulator.c regulator: Add driver for MT6331 PMIC regulators 2022-09-13 15:04:56 +01:00
mt6332-regulator.c regulator: Add driver for MT6332 PMIC regulators 2022-09-13 15:04:58 +01:00
mt6357-regulator.c regulator: add mt6357 regulator 2022-12-02 12:23:19 +00:00
mt6358-regulator.c regulator: mt6366: Add support for MT6366 regulator 2022-04-04 15:16:10 +01:00
mt6359-regulator.c
mt6360-regulator.c
mt6370-regulator.c regulator: mt6370: Use the correct header for platform_device_id 2022-06-29 16:31:42 +01:00
mt6380-regulator.c regulator: mt6380: Fix unused array warning 2022-07-27 13:14:46 +01:00
mt6397-regulator.c
mtk-dvfsrc-regulator.c
of_regulator.c regulator: core: Use different devices for resource allocation and DT lookup 2022-12-08 13:02:37 +00:00
palmas-regulator.c
pbias-regulator.c
pca9450-regulator.c regulator: pca9450-regulator: Convert to i2c's .probe_new() 2022-11-22 19:37:29 +00:00
pcap-regulator.c
pcf50633-regulator.c
pf8x00-regulator.c
pfuze100-regulator.c regulator: pfuze100-regulator: Convert to i2c's .probe_new() 2022-11-24 13:54:08 +00:00
pv88060-regulator.c
pv88060-regulator.h
pv88080-regulator.c regulator: pv88080-regulator: Convert to i2c's .probe_new() 2022-11-24 13:54:09 +00:00
pv88080-regulator.h
pv88090-regulator.c
pv88090-regulator.h
pwm-regulator.c
qcom-labibb-regulator.c regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe() 2022-12-07 14:19:18 +00:00
qcom-rpmh-regulator.c regulator: qcom-rpmh: PM8550 ldo11 regulator is an nldo 2023-01-03 15:54:38 +00:00
qcom_rpm-regulator.c regulator: qcom_rpm: Fix circular deferral regression 2022-09-09 22:27:12 +01:00
qcom_smd-regulator.c regulator: qcom_smd: Fix PMR735a S3 regulator spec 2022-11-10 12:52:29 +00:00
qcom_spmi-regulator.c regulator: qcom_spmi: Add PM6125 PMIC support 2022-08-23 18:07:56 +01:00
qcom_usb_vbus-regulator.c
rc5t583-regulator.c
rk808-regulator.c regulator: rk808: Use dev_err_probe 2022-11-28 13:04:41 +00:00
rn5t618-regulator.c
rohm-regulator.c regulator: rohm-regulator: add helper for restricted voltage setting 2021-11-18 13:57:47 +00:00
rpi-panel-attiny-regulator.c regulator: rpi-panel-attiny-regulator: Convert to i2c's .probe_new() 2022-11-22 19:37:30 +00:00
rt4801-regulator.c regulator: richtek,rt4801: parse GPIOs per regulator 2022-04-25 14:00:47 +01:00
rt4831-regulator.c regulator: rt4831: Add active_discharge_on to fix discharge API 2022-03-25 16:09:31 +00:00
rt5033-regulator.c
rt5120-regulator.c regulator: rt5120: Add PMIC regulator support 2022-06-23 13:07:50 +01:00
rt5190a-regulator.c regulator: rt5190a: check if init_data is NULL, bypass rt5190a_of_parse_cb 2022-06-06 12:39:10 +01:00
rt5759-regulator.c regulator: rt5759: fix OOB in validate_desc() 2022-11-16 10:50:17 +00:00
rt6160-regulator.c
rt6190-regulator.c regulator: rt6190: Add support for Richtek RT6190 regulator 2022-11-02 14:38:36 +00:00
rt6245-regulator.c
rtmv20-regulator.c
rtq2134-regulator.c regulator: rtq2134: Fix missing active_discharge_on setting 2022-04-04 08:38:57 +01:00
rtq6752-regulator.c
s2mpa01.c
s2mps11.c
s5m8767.c regulator: s5m8767: Bounds check id indexing into arrays 2023-03-10 09:29:18 +01:00
sc2731-regulator.c regulator: cleanup comments 2022-03-07 13:15:01 +00:00
scmi-regulator.c regulator: scmi: Add missing of_node_get() 2022-06-30 13:25:37 +01:00
sky81452-regulator.c
slg51000-regulator.c regulator: slg51000: Wait after asserting CS pin 2022-11-18 14:02:11 +00:00
slg51000-regulator.h
sm5703-regulator.c regulator: sm5703-regulator: Add regulators support for SM5703 MFD 2022-04-26 15:13:48 +01:00
stm32-booster.c
stm32-pwr.c regulator: stm32-pwr: fix of_iomap leak 2023-05-11 23:11:06 +09:00
stm32-vrefbuf.c regulator: core: Use different devices for resource allocation and DT lookup 2022-12-08 13:02:37 +00:00
stpmic1_regulator.c
stw481x-vmmc.c
sy7636a-regulator.c regulator: sy7636a: Remove requirement on sy7636a mfd 2022-02-08 09:27:28 +00:00
sy8106a-regulator.c regulator: Drop obsolete dependencies on COMPILE_TEST 2022-11-24 16:30:19 +00:00
sy8824x.c regulator: Drop obsolete dependencies on COMPILE_TEST 2022-11-24 16:30:19 +00:00
sy8827n.c regulator: Drop obsolete dependencies on COMPILE_TEST 2022-11-24 16:30:19 +00:00
ti-abb-regulator.c regulator: of: Fix kernel-doc 2022-09-19 15:44:17 +01:00
tps6105x-regulator.c
tps6286x-regulator.c regulator: tps6286x-regulator: Convert to i2c's .probe_new() 2022-11-22 19:37:32 +00:00
tps6507x-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
tps6524x-regulator.c
tps6586x-regulator.c
tps51632-regulator.c regulator: tps51632-regulator: Convert to i2c's .probe_new() 2022-11-22 19:37:31 +00:00
tps62360-regulator.c regulator: tps62360-regulator: Convert to i2c's .probe_new() 2022-11-23 14:17:45 +00:00
tps65023-regulator.c regulator: tps65023-regulator: Convert to i2c's .probe_new() 2022-11-23 14:17:46 +00:00
tps65086-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE 2022-06-10 14:51:36 +02:00
tps65090-regulator.c
tps65132-regulator.c
tps65217-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
tps65218-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE 2022-06-10 14:51:36 +02:00
tps65219-regulator.c regulator: tps65219: use generic set_bypass() 2023-03-10 09:28:37 +01:00
tps65910-regulator.c
tps65912-regulator.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_319.RULE 2022-06-10 14:51:36 +02:00
tps68470-regulator.c regulator: Introduce tps68470-regulator driver 2021-12-15 22:16:53 +00:00
twl-regulator.c drivers/regulator: remove redundant ret variable 2021-12-13 19:35:43 +00:00
twl6030-regulator.c regulator: twl6030: fix get status of twl6032 regulators 2022-11-22 12:23:06 +00:00
uniphier-regulator.c
userspace-consumer.c regulator: userspace-consumer: Handle regulator-output DT nodes 2022-11-03 13:35:06 +00:00
vctrl-regulator.c regulator: vctrl: Use min() instead of doing it manually 2022-03-15 12:03:51 +00:00
vexpress-regulator.c
virtual.c regulator: virtual: add devicetree support 2022-03-02 13:45:31 +00:00
vqmmc-ipq4019-regulator.c
wm831x-dcdc.c
wm831x-isink.c
wm831x-ldo.c
wm8350-regulator.c regulator: cleanup comments 2022-03-07 13:15:01 +00:00
wm8400-regulator.c
wm8994-regulator.c regulator: wm8994: Add an off-on delay for WM8994 variant 2022-04-04 08:38:56 +01:00