summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorKees Cook <kees+treewide@kernel.org>2026-10-28 23:08:12 -0700
committerKees Cook <kees@kernel.org>2026-11-05 21:55:37 -0800
commit0af298e62e5cff4ebf9bec47b8711177a7e2f115 (patch)
treee0582f1712814a4a71743467f2ad2ca6566165ce /kernel/workqueue.c
parentd68ce4e71248e1ff5af9654b407541d9260b3ba5 (diff)
treewide: refresh kmalloc_obj() conversions
Refresh the tree with run of the existing Coccinelle rules in scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert arrays of multi-byte integers. The conversions break down as: 435 kzalloc_objs() 169 kmalloc_objs() 52 kvzalloc_objs() 47 kzalloc_obj() 42 kvmalloc_objs() 8 kmalloc_obj() 2 kzalloc_flex() 2 kvmalloc_flex() and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL. Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC 16.2.0 with no new warnings. Signed-off-by: Kees Cook <kees+treewide@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f2e8071a6f4e..af845214e78b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5267,7 +5267,7 @@ static int alloc_flush_pnodes(struct workqueue_struct *wq)
struct wq_flush_pnode *fpn;
int node;
- wq->flush_pnodes = kcalloc(nr_node_ids + 1, sizeof(*wq->flush_pnodes), GFP_KERNEL);
+ wq->flush_pnodes = kzalloc_objs(*wq->flush_pnodes, nr_node_ids + 1);
if (!wq->flush_pnodes)
return -ENOMEM;