mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] regulator: of: Fixes to of_regulator_bulk_get_all()
@ 2026-09-29 10:05 Alexey Charkov
  2026-09-29 10:05 ` [PATCH 1/4] regulator: of: fill in supply names in of_regulator_bulk_get_all() Alexey Charkov
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alexey Charkov @ 2026-09-29 10:05 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Corentin Labbe, Manivannan Sadhasivam,
	Bartosz Golaszewski, Bjorn Helgaas, Krzysztof Wilczyński
  Cc: linux-kernel, Manivannan Sadhasivam, Bartosz Golaszewski,
	linux-pci, linux-pm, Alexey Charkov, stable, Sashiko

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@flipper.net>
---
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@flipper.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-01 16:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 10:05 [PATCH 0/4] regulator: of: Fixes to of_regulator_bulk_get_all() Alexey Charkov
2026-09-29 10:05 ` [PATCH 1/4] regulator: of: fill in supply names in of_regulator_bulk_get_all() Alexey Charkov
2026-09-29 10:05 ` [PATCH 2/4] regulator: of: state who owns the array from of_regulator_bulk_get_all() Alexey Charkov
2026-09-29 10:05 ` [PATCH 3/4] power: sequencing: pcie-m2: Fix leaking " Alexey Charkov
2026-09-29 10:05 ` [PATCH 4/4] PCI/pwrctrl: generic: " Alexey Charkov
2026-10-01  7:52   ` Bartosz Golaszewski
2026-10-01 16:46   ` Bjorn Helgaas
2026-10-01 16:51     ` Bjorn Helgaas
2026-09-29 15:31 ` [PATCH 0/4] regulator: of: Fixes to of_regulator_bulk_get_all() Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®