[PATCH 0/4] regulator: of: Fixes to of_regulator_bulk_get_all()

From: Alexey Charkov

Date: Tue Sep 29 2026 - 06:12:34 EST


of_regulator_bulk_get_all() only fills in the .consumer part of the
struct regulator_bulk_data for the regulators it gets, leaving .supply as
garbage, while the rest of the regulator core expects a meaningful name
there (e.g. for error prints), causing uninitialized memory access in any
failure paths in the core.

It also allocates the supplies array and hands it to callers, but never
says the callers need to free it (which they don't), causing leaks.

Fix both (the latter in two instances).

Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
---
Alexey Charkov (4):
regulator: of: fill in supply names in of_regulator_bulk_get_all()
regulator: of: state who owns the array from of_regulator_bulk_get_all()
power: sequencing: pcie-m2: Fix leaking array from of_regulator_bulk_get_all()
PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all()

drivers/pci/pwrctrl/generic.c | 1 +
drivers/power/sequencing/pwrseq-pcie-m2.c | 2 ++
drivers/regulator/of_regulator.c | 29 ++++++++++++++++++++++-------
3 files changed, 25 insertions(+), 7 deletions(-)
---
base-commit: 6375e61c01e93e35ee7acd336a689ac1fae4b509
change-id: 20260929-regulator-get-all-a553e73ff1ce

Best regards,
--
Alexey Charkov <alchark@xxxxxxxxxxx>