From: Gongwei Li <[email protected]>

Replace kmalloc() with kmalloc_array() to prevent potential
overflow, as recommended in Documentation/process/deprecated.rst.

Signed-off-by: Gongwei Li <[email protected]>
---
 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


Reply via email to