* [PATCH] firmware: ti_sci: replace kcalloc with kzalloc for buffer pointer allocation
@ 2026-09-18 12:08 Siddharth Karanam
0 siblings, 0 replies; only message in thread
From: Siddharth Karanam @ 2026-09-18 12:08 UTC (permalink / raw)
To: nm, kristo, ssantosh; +Cc: linux-arm-kernel, linux-kernel, Siddharth Karanam
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>
---
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 33d7c4a4181e..8e346440e539 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;
--
2.55.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-18 12:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-18 12:08 [PATCH] firmware: ti_sci: replace kcalloc with kzalloc for buffer pointer allocation Siddharth Karanam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®