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