diff options
| author | Kees Cook <kees+treewide@kernel.org> | 2026-09-17 14:15:40 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-23 14:49:39 +0200 |
| commit | 9b0bc6f8b31432f466915119b5e9c2baef2552f8 (patch) | |
| tree | 1a8e3973435c8d4362e06a38d5119a8f75dc86fd /tools/perf/scripts/python/stackcollapse.py | |
| parent | 7c08f3c4da9205fc64a9c99180f9cffc3e435f7f (diff) | |
| download | linux-next-9b0bc6f8b31432f466915119b5e9c2baef2552f8.tar.gz linux-next-9b0bc6f8b31432f466915119b5e9c2baef2552f8.zip | |
vt: keyboard: Allocate new_map with ARRAY_SIZE()
In preparation for converting the kmalloc family of allocators to the
type-aware kmalloc_obj family, we need to make sure that the returned
type from the allocation matches the type of the variable being
assigned. (The kmalloc family returns "void *", which can be implicitly
cast to any pointer type.)
The new key map has as many entries as plain_map, but the size was taken
from the whole array, which would make the allocation type a pointer to
the array rather than the "unsigned short *" being assigned. Allocate
ARRAY_SIZE-many entries instead. The resulting allocation size is the
same.
Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0:
drivers/tty/vt/keyboard.o
Assisted-by: LLM coccinelle
Signed-off-by: Kees Cook <kees+treewide@kernel.org>
Link: https://patch.msgid.link/20260917211539.i.636-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
