Skip to content

Commit 1c7bbae

Browse files
committed
coccinelle: kmalloc_obj: Remove default GFP_KERNEL arg
Remove any GFP_KERNEL arguments found in the new kmalloc_obj-family helpers. This captures the script used in commit 189f164 ("Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses"). Link: https://patch.msgid.link/20260320175113.work.016-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 11439c4 commit 1c7bbae

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

scripts/coccinelle/api/kmalloc_objs.cocci

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,14 @@ fresh identifier ALLOC_OBJS = script:python(ALLOC_ARRAY) { alloc_array(ALLOC_ARR
122122
- ALLOC(struct_size_t(TYPE, FLEX, COUNT), GFP)
123123
+ ALLOC_FLEX(TYPE, FLEX, COUNT, GFP)
124124
)
125+
126+
@drop_gfp_kernel depends on patch && !(file in "tools") && !(file in "samples")@
127+
identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
128+
kzalloc_obj,kzalloc_objs,kzalloc_flex,
129+
kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
130+
kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
131+
@@
132+
133+
ALLOC(...
134+
- , GFP_KERNEL
135+
)

0 commit comments

Comments
 (0)