]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: fsl: qbman: use kmalloc_array() instead of kmalloc()
authorGongwei Li <ligongwei@kylinos.cn>
Fri, 21 Nov 2025 06:10:22 +0000 (14:10 +0800)
committerChristophe Leroy (CS GROUP) <chleroy@kernel.org>
Wed, 26 Nov 2025 11:29:40 +0000 (12:29 +0100)
Replace kmalloc() with kmalloc_array() to prevent potential
overflow, as recommended in Documentation/process/deprecated.rst.

Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
Reviewed-by: Fushuai Wang <wangfushuai@baidu.com>
Link: https://lore.kernel.org/r/20251121061022.114609-1-13875017792@163.com
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
drivers/soc/fsl/qbman/qman_test_stash.c

index 6f7597950aa394495d08581d54fad927928b0989..6009e8b32c44938cd65c9aae814967042fcd8107 100644 (file)
@@ -219,7 +219,7 @@ static int allocate_frame_data(void)
 
        pcfg = qman_get_qm_portal_config(qman_dma_portal);
 
-       __frame_ptr = kmalloc(4 * HP_NUM_WORDS, GFP_KERNEL);
+       __frame_ptr = kmalloc_array(4, HP_NUM_WORDS, GFP_KERNEL);
        if (!__frame_ptr)
                return -ENOMEM;