Skip to contentSkip to conversation

kunit/fortify: Remove __kmalloc_node() test

PATCH In review Kees Cook 2 participants 2 messages May 31, 2024 – Jun 1, 2024

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 kunit/fortify: Remove __kmalloc_node() test

__kmalloc_node() is considered an "internal" function to the Slab, so drop it from explicit testing.

---
Cc: Vlastimil Babka <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 lib/fortify_kunit.c | 3 ---
 1 file changed, 3 deletions(-)
lib/fortify_kunit.c +0 -3
index 39da5b3bc649..f9cc467334ce 100644
@@ -235,9 +235,6 @@ static void fortify_test_alloc_size_##allocator##_dynamic(struct kunit *test) \
 		kmalloc_array_node(alloc_size, 1, gfp, NUMA_NO_NODE),	\
 		kfree(p));						\
 	checker(expected_size, __kmalloc(alloc_size, gfp),		\
-		kfree(p));						\
-	checker(expected_size,						\
-		__kmalloc_node(alloc_size, gfp, NUMA_NO_NODE),		\
 		kfree(p));						\
 									\
 	orig = kmalloc(alloc_size, gfp);				\
Signature · 1 line
2.34.1
#1 lore raw
Quoted 2 lines · Kees Cook

__kmalloc_node() is considered an "internal" function to the Slab, so drop it from explicit testing.

So is __kmalloc() and so I have the removal of both as part of the cleanup here:

https://lore.kernel.org/all/[email protected]/

which reminds me I should put it to -next at this point. Review still welcome :)

Quoted 23 lines

---
Cc: Vlastimil Babka <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 lib/fortify_kunit.c | 3 ---
 1 file changed, 3 deletions(-)
lib/fortify_kunit.c +0 -3
index 39da5b3bc649..f9cc467334ce 100644
@@ -235,9 +235,6 @@ static void fortify_test_alloc_size_##allocator##_dynamic(struct kunit *test) \
 		kmalloc_array_node(alloc_size, 1, gfp, NUMA_NO_NODE),	\
 		kfree(p));						\
 	checker(expected_size, __kmalloc(alloc_size, gfp),		\
-		kfree(p));						\
-	checker(expected_size,						\
-		__kmalloc_node(alloc_size, gfp, NUMA_NO_NODE),		\
 		kfree(p));						\
 									\
 	orig = kmalloc(alloc_size, gfp);				\