Skip to content

Commit 0aead81

Browse files
Harini TJassi Brar
authored andcommitted
mailbox: zynqmp-ipi: Fix out-of-bounds access in mailbox cleanup loop
The cleanup loop was starting at the wrong array index, causing out-of-bounds access. Start the loop at the correct index for zero-indexed arrays to prevent accessing memory beyond the allocated array bounds. Fixes: 4981b82 ("mailbox: ZynqMP IPI mailbox controller") Signed-off-by: Harini T <harini.t@amd.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 019e3f4 commit 0aead81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mailbox/zynqmp-ipi-mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata)
890890
if (pdata->irq < MAX_SGI)
891891
xlnx_mbox_cleanup_sgi(pdata);
892892

893-
i = pdata->num_mboxes;
893+
i = pdata->num_mboxes - 1;
894894
for (; i >= 0; i--) {
895895
ipi_mbox = &pdata->ipi_mboxes[i];
896896
if (device_is_registered(&ipi_mbox->dev))

0 commit comments

Comments
 (0)