crypto: iaa: Adjust workqueue allocation type
Subsystems (2)
PATCH 1/1 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.
---
Cc: Kristen Accardi <[email protected]>
Cc: Vinicius Costa Gomes <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: <[email protected]>
--- drivers/crypto/intel/iaa/iaa_crypto_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/intel/iaa/iaa_crypto_main.c +1 -1
@@ -725,7 +725,7 @@ static int alloc_wq_table(int max_wqs)for (cpu =0 ; cpu < nr_cpus; cpu++) { entry =per_cpu_ptr (wq_table, cpu); - entry->wqs =kcalloc (max_wqs,sizeof (struct wq *),GFP_KERNEL ); + entry->wqs =kcalloc (max_wqs,sizeof (*entry->wqs),GFP_KERNEL );if (!entry->wqs) {free_wq_table ();return -ENOMEM ;
Signature · 1 line
2.34.1
Herbert Xu
maintainerQuoted 16 lines · Kees Cook
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 <[email protected]>---
Cc: Kristen Accardi <[email protected]>
Cc: Vinicius Costa Gomes <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: <[email protected]>
Quoted 3 lines
--- drivers/crypto/intel/iaa/iaa_crypto_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt