linux/block/partitions
Kees Cook 69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
..
acorn.c block/partitions/acorn: Remove redundant assignments 2022-04-23 07:15:26 -06:00
aix.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
amiga.c block/partition: fix signedness issue for Amiga partitions 2023-07-05 16:34:56 -06:00
atari.c block/partitions/atari: Remove redundant assignment 2022-04-23 07:15:26 -06:00
atari.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
check.h block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
cmdline.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
core.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
efi.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
efi.h block: remove genhd.h 2022-02-02 07:49:59 -07:00
ibm.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
karma.c block: remove block/partitions/karma.h 2020-03-24 07:57:08 -06:00
Kconfig block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
ldm.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ldm.h partitions: ldm: remove the initial kernel-doc notation 2025-01-13 07:47:19 -07:00
mac.c partitions: mac: fix handling of bogus partition table 2025-02-14 08:38:28 -07:00
mac.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
Makefile block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
msdos.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
of.c block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
osf.c block: remove block/partitions/osf.h 2020-03-24 07:57:08 -06:00
sgi.c block: Remove commented out code 2025-02-21 17:12:21 -07:00
sun.c block: Remove commented out code 2025-02-21 17:12:21 -07:00
sysv68.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
ultrix.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00