diff options
| author | Kees Cook <kees+treewide@kernel.org> | 2026-09-17 14:13:16 -0700 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-18 17:59:09 +0100 |
| commit | b53a09c957b682ce1d1f8e94a362c4466b6b74f6 (patch) | |
| tree | 02a6605ed163944f816999887c8940a505243c01 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 195bbe5e1c29aa1349655a6162958149c1176034 (diff) | |
regulator: axp20x: Remove const from new_desc allocation types
In preparation for making the devm_kmalloc family of allocators type
aware, we need to make sure that the returned type from the allocation
matches the type of the variable being assigned. (Before, the allocator
would always return "void *", which can be implicitly cast to any
pointer type.)
The assigned type is "struct regulator_desc *", but the converted
allocation types would be "const struct regulator_desc *", as all three
sizeof()s were taken from "*desc", and "desc" is
"const struct regulator_desc *". As there is no general way to remove
const qualifiers, take the size from the assignment target instead. No
change in allocation size results.
Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0:
drivers/regulator/axp20x-regulator.o
Assisted-by: LLM coccinelle
Signed-off-by: Kees Cook <kees+treewide@kernel.org>
Link: https://patch.msgid.link/20260917211315.i.973-kees@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
