diff options
| author | Alexey Charkov <alchark@flipper.net> | 2026-09-30 20:13:03 +0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-04 18:29:12 +0200 |
| commit | e2151c29cec73f6cc70abf1c7cbc7b9b202489f5 (patch) | |
| tree | 87641c110ffa4e308e4f18d73099a1f3be779e2f /tools/lib/python/kdoc/parse_data_structs.py | |
| parent | 72d3fcf802c45d00b300f25b848a93c3a2bd7c7e (diff) | |
| download | linux-next-e2151c29cec73f6cc70abf1c7cbc7b9b202489f5.tar.gz linux-next-e2151c29cec73f6cc70abf1c7cbc7b9b202489f5.zip | |
regulator: of: fill in supply names in of_regulator_bulk_get_all()
of_regulator_bulk_get_all() returns an array it allocated itself, and
fills in only the consumer of each entry. Every other way of getting a
bulk array has the supply name set, because the caller provides it, and
the core expects it to be there: regulator_bulk_enable() prints it when
a supply fails to enable, so a caller that hands such an array to it
dereferences uninitialised memory on that path.
Copy each name into the array's own allocation, right behind the
entries, so that it shares the array's lifetime and callers still have
nothing extra to free. That also retires the fixed 64 byte stack buffer
the names were assembled in, which is_supply_name() never bounded the
copy against.
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260928-b4-rk3576-reboot-mode-v1-0-65486b03bd41@flipper.net?part=3
Fixes: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all")
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260930-regulator-get-all-v2-1-ca82070d22f2@flipper.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/parse_data_structs.py')
0 files changed, 0 insertions, 0 deletions
