From 6ace5611ac85887a593b7eae2b7edec8dfeb2ffa Mon Sep 17 00:00:00 2001 From: Siddharth Karanam Date: Fri, 18 Sep 2026 17:38:39 +0530 Subject: [PATCH] firmware: ti_sci: replace kcalloc with kzalloc for buffer pointer allocation Previously, the buffer pointer was being allocated via devm_kcalloc that would check for a mul overflow before allocating n * size bytes (size being desc->max_msg_size), but since n is 1 here, we can instead use devm_kzalloc that allocates the size directly. Signed-off-by: Siddharth Karanam Link: https://patch.msgid.link/20260918120839.207459-1-sid9.karanam@gmail.com Signed-off-by: Nishanth Menon --- drivers/firmware/ti_sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 94104edba9a0..8025a4cdd35c 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -4132,7 +4132,7 @@ static int ti_sci_probe(struct platform_device *pdev) /* Pre-initialize the buffer pointer to pre-allocated buffers */ for (i = 0, xfer = minfo->xfer_block; i < desc->max_msgs; i++, xfer++) { - xfer->xfer_buf = devm_kcalloc(dev, 1, desc->max_msg_size, + xfer->xfer_buf = devm_kzalloc(dev, desc->max_msg_size, GFP_KERNEL); if (!xfer->xfer_buf) return -ENOMEM;