mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
e0d2919867
commit
6ace5611ac
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user