From: Alexey Charkov <alchark@flipper.net>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Corentin Labbe <clabbe@baylibre.com>
Cc: Alexey Charkov <alchark@flipper.net>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH v2 0/2] regulator: of: Fixes to of_regulator_bulk_get_all()
Date: Wed, 30 Sep 2026 20:13:02 +0400 [thread overview]
Message-ID: <20260930-regulator-get-all-v2-0-ca82070d22f2@flipper.net> (raw)
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 currently), causing
leaks.
Fix the former and document the latter in the kerneldoc to help any new
users avoid the leak.
Signed-off-by: Alexey Charkov <alchark@flipper.net>
---
Changes in v2:
- Split by subsystem for easier application, per Mark's feedback
- Link to v1: https://patch.msgid.link/20260929-regulator-get-all-v1-0-e887c66a47f1@flipper.net
To: Liam Girdwood <lgirdwood@gmail.com>
To: Mark Brown <broonie@kernel.org>
To: Corentin Labbe <clabbe@baylibre.com>
Cc: linux-kernel@vger.kernel.org
---
Alexey Charkov (2):
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()
drivers/regulator/of_regulator.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
---
base-commit: 6c2cb8b8b843d216ab549b678a0d8831c43153e0
change-id: 20260929-regulator-get-all-a553e73ff1ce
Best regards,
--
Alexey Charkov <alchark@flipper.net>
next reply other threads:[~2026-09-30 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 16:13 Alexey Charkov [this message]
2026-09-30 16:13 ` [PATCH v2 1/2] regulator: of: fill in supply names in of_regulator_bulk_get_all() Alexey Charkov
2026-09-30 16:13 ` [PATCH v2 2/2] regulator: of: state who owns the array from of_regulator_bulk_get_all() Alexey Charkov
2026-10-04 16:29 ` [PATCH v2 0/2] regulator: of: Fixes to of_regulator_bulk_get_all() Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260930-regulator-get-all-v2-0-ca82070d22f2@flipper.net \
--to=alchark@flipper.net \
--cc=broonie@kernel.org \
--cc=clabbe@baylibre.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®