* [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc()
@ 2025-11-21 6:10 Gongwei Li
2025-11-21 10:48 ` Fushuai Wang
2025-11-22 10:11 ` Christophe Leroy (CS GROUP)
0 siblings, 2 replies; 3+ messages in thread
From: Gongwei Li @ 2025-11-21 6:10 UTC (permalink / raw)
To: christophe.leroy
Cc: wangfushuai, frederic, ligongwei, linuxppc-dev, linux-arm-kernel,
linux-kernel
From: Gongwei Li <ligongwei@kylinos.cn>
Replace kmalloc() with kmalloc_array() to prevent potential
overflow, as recommended in Documentation/process/deprecated.rst.
Signed-off-by: Gongwei Li <ligongwei@kylinos.cn>
---
drivers/soc/fsl/qbman/qman_test_stash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/fsl/qbman/qman_test_stash.c b/drivers/soc/fsl/qbman/qman_test_stash.c
index 6f7597950aa3..6009e8b32c44 100644
--- a/drivers/soc/fsl/qbman/qman_test_stash.c
+++ b/drivers/soc/fsl/qbman/qman_test_stash.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc()
2025-11-21 6:10 [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc() Gongwei Li
@ 2025-11-21 10:48 ` Fushuai Wang
2025-11-22 10:11 ` Christophe Leroy (CS GROUP)
1 sibling, 0 replies; 3+ messages in thread
From: Fushuai Wang @ 2025-11-21 10:48 UTC (permalink / raw)
To: 13875017792
Cc: christophe.leroy, frederic, ligongwei, linux-arm-kernel,
linux-kernel, linuxppc-dev, wangfushuai
> 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>
---
Regards,
Wang.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc()
2025-11-21 6:10 [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc() Gongwei Li
2025-11-21 10:48 ` Fushuai Wang
@ 2025-11-22 10:11 ` Christophe Leroy (CS GROUP)
1 sibling, 0 replies; 3+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2025-11-22 10:11 UTC (permalink / raw)
To: Christophe Leroy, Gongwei Li
Cc: wangfushuai, frederic, ligongwei, linuxppc-dev, linux-arm-kernel,
linux-kernel
On Fri, 21 Nov 2025 14:10:22 +0800, Gongwei Li wrote:
> Replace kmalloc() with kmalloc_array() to prevent potential
> overflow, as recommended in Documentation/process/deprecated.rst.
>
>
Applied, thanks!
[1/1] soc/qman: use kmalloc_array() instead of kmalloc()
commit: 4ee2a8883d9cd6370a2f858e886f16d7414c9c2f
Best regards,
--
Christophe Leroy (CS GROUP) <chleroy@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-22 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 6:10 [PATCH 1/1] soc/qman: use kmalloc_array() instead of kmalloc() Gongwei Li
2025-11-21 10:48 ` Fushuai Wang
2025-11-22 10:11 ` Christophe Leroy (CS GROUP)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).