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 <sid9.karanam@gmail.com>
Link: https://patch.msgid.link/20260918120839.207459-1-sid9.karanam@gmail.com
Signed-off-by: Nishanth Menon <nm@ti.com>
This commit is contained in:
Siddharth Karanam 2026-09-18 17:38:39 +05:30 committed by Nishanth Menon
parent e0d2919867
commit 6ace5611ac

View File

@ -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;