Skip to content

Commit 5a15c87

Browse files
committed
crypto: iaa - Adjust workqueue allocation type
JIRA: https://issues.redhat.com/browse/RHEL-95629 Upstream Status: merged into the linux.git commit db4978d Author: Kees Cook <kees@kernel.org> Date: Fri Apr 25 23:11:31 2025 -0700 crypto: iaa - Adjust workqueue allocation type In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct idxd_wq **", but the returned type will be "struct wq **". These are the same size allocation (pointer sized), but the types don't match. Adjust the allocation type to match the assignment. Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Vladis Dronov <vdronov@redhat.com>
1 parent c3d5212 commit 5a15c87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/intel/iaa/iaa_crypto_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static int alloc_wq_table(int max_wqs)
727727

728728
for (cpu = 0; cpu < nr_cpus; cpu++) {
729729
entry = per_cpu_ptr(wq_table, cpu);
730-
entry->wqs = kcalloc(max_wqs, sizeof(struct wq *), GFP_KERNEL);
730+
entry->wqs = kcalloc(max_wqs, sizeof(*entry->wqs), GFP_KERNEL);
731731
if (!entry->wqs) {
732732
free_wq_table();
733733
return -ENOMEM;

0 commit comments

Comments
 (0)