Commit 4c634b6
crypto: qat - use kcalloc() in qat_uclo_map_objs_from_mof()
As noted in the kernel documentation [1], open-coded multiplication in
allocator arguments is discouraged because it can lead to integer overflow.
Use kcalloc() to gain built-in overflow protection, making memory
allocation safer when calculating allocation size compared to explicit
multiplication. Similarly, use size_add() instead of explicit addition
for 'uobj_chunk_num + sobj_chunk_num'.
Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments #1
Signed-off-by: Qianfeng Rong <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Giovanni Cabiddu <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>1 parent dcd2d5f commit 4c634b6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1900 | 1900 | | |
1901 | 1901 | | |
1902 | 1902 | | |
1903 | | - | |
| 1903 | + | |
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
| |||
0 commit comments