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
..
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2025-05-02 10:23:47 +02:00
2025-12-02 20:15:51 +01:00
2025-07-27 19:56:51 +02:00
2026-02-21 01:02:28 -08:00
2025-09-30 23:21:34 +02:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2026-02-14 11:07:12 +01:00
2024-04-25 12:04:18 +02:00
2025-06-16 09:08:06 +02:00
2026-02-21 01:02:28 -08:00
2023-10-19 12:54:16 +02:00
2023-11-29 12:20:08 +01:00
2024-10-08 21:47:18 +02:00
2024-10-08 21:47:18 +02:00
2026-02-21 01:02:28 -08:00
2023-08-04 15:54:34 +02:00
2023-10-19 12:54:38 +02:00
2024-11-04 14:25:33 +10:00
2026-02-19 17:38:17 +01:00
2026-02-14 11:09:47 +01:00
2024-10-08 21:47:18 +02:00
2024-10-15 10:07:32 +02:00
2025-06-16 09:06:58 +02:00
2025-06-16 09:06:58 +02:00
2026-02-21 01:02:28 -08:00
2025-05-31 10:24:01 +02:00
2024-10-15 10:07:32 +02:00
2024-10-15 10:07:32 +02:00
2024-10-15 10:07:32 +02:00
2024-09-30 16:35:28 +02:00
2023-10-19 12:54:52 +02:00
2024-11-22 16:29:57 -08:00
2024-10-08 21:47:18 +02:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2025-06-16 09:07:03 +02:00
2023-10-19 12:55:07 +02:00
2025-12-16 14:12:44 +01:00
2024-10-08 21:47:18 +02:00
2026-02-14 11:09:47 +01:00
2023-08-04 15:54:35 +02:00
2025-03-26 22:39:21 +01:00
2023-09-02 08:18:40 -07:00
2025-11-15 13:46:45 +01:00
2026-02-21 01:02:28 -08:00
2024-10-08 21:47:18 +02:00
2025-11-15 13:46:45 +01:00
2024-10-08 21:47:18 +02:00
2024-10-08 21:47:18 +02:00
2024-10-08 21:47:18 +02:00
2024-08-30 18:42:38 +02:00
2024-01-18 21:10:41 +01:00
2024-09-02 13:54:26 +02:00
2025-07-27 19:56:51 +02:00
2026-02-19 17:38:17 +01:00
2024-10-15 10:07:32 +02:00
2023-08-04 15:54:36 +02:00
2025-06-16 09:06:19 +02:00
2026-02-14 11:07:12 +01:00
2023-08-04 15:54:36 +02:00
2024-10-08 21:47:18 +02:00
2026-02-21 01:02:28 -08:00
2024-10-08 21:47:18 +02:00
2024-10-08 21:47:18 +02:00
2024-10-15 10:07:32 +02:00
2024-10-08 21:47:18 +02:00
2023-10-19 12:56:00 +02:00
2023-10-19 12:56:04 +02:00
2023-08-04 15:54:37 +02:00
2023-08-04 15:54:37 +02:00
2023-08-04 15:54:37 +02:00
2023-11-29 12:20:44 +01:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2024-10-08 21:47:18 +02:00
2025-12-02 19:49:10 +01:00
2023-08-04 15:54:38 +02:00
2024-10-08 21:47:18 +02:00
2024-10-08 21:47:18 +02:00
2025-09-30 23:21:34 +02:00
2023-11-29 12:20:44 +01:00
2025-06-16 09:06:19 +02:00
2024-10-15 10:07:32 +02:00
2024-11-14 15:26:27 +01:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2023-07-24 16:50:38 +02:00
2026-02-21 01:02:28 -08:00
2023-11-29 12:20:10 +01:00
2026-02-21 01:02:28 -08:00
2025-12-05 11:29:14 +01:00
2024-10-15 10:07:31 +02:00
2024-01-23 09:13:24 +01:00
2023-10-19 12:56:55 +02:00
2023-08-24 07:26:06 +10:00
2023-08-24 07:26:06 +10:00
2025-12-02 19:44:05 +01:00
2024-01-18 21:10:41 +01:00
2024-01-27 19:03:51 -08:00
2025-12-02 20:08:35 +01:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 01:02:28 -08:00
2025-12-16 14:12:44 +01:00
2024-10-08 21:47:18 +02:00
2025-12-16 14:12:44 +01:00
2026-02-14 11:09:46 +01:00
2024-03-16 08:29:48 +01:00
2024-10-08 21:47:18 +02:00
2025-06-16 09:06:19 +02:00
2026-02-21 01:02:28 -08:00
2024-10-08 21:47:18 +02:00