Hello,
This commit, now part of next-20250807[1], is causing kernel boot crash on AMD EPYC Milan platform.
commit c3f772c384c8ec0796a73c80f89a31ff862c1295 (HEAD) Author: Zhen Ni zhen.ni@easystack.cn Date: Tue Aug 5 11:48:29 2025 +0800
mailbox: pcc: Add missed acpi_put_table() to fix memory leak
Fixes a permanent ACPI memory leak in the success path by adding acpi_put_table(). Renaming generic 'err' label to 'put_table' for clarity.
Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni zhen.ni@easystack.cn Signed-off-by: Jassi Brar jassisinghbrar@gmail.com
Attaching both the dmesg and kernel config here.
If I go back 1 commit [i.e 75f1fbc9fd409a0c232dc78871ee7df186da9d57], things work fine.
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=n...
Reported-by: Srikanth Aithal sraithal@amd.com
On 8/5/2025 9:18 AM, Zhen Ni wrote:
Fixes a permanent ACPI memory leak in the success path by adding acpi_put_table(). Renaming generic 'err' label to 'put_table' for clarity.
Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni zhen.ni@easystack.cn
Changes in v4:
- Change goto target from err to put_table.
- Remove goto tatget err_nomem
- Update commit msg
Changes in v3:
- Add goto label err_nomem, keep the err label.
- Update commit msg
Changes in v2:
- Add tags of 'Fixes' and 'Cc'
- Change goto target from out_put_pcct to e_nomem
drivers/mailbox/pcc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index f6714c233f5a..d8420c87b615 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -763,19 +763,19 @@ static int pcc_mbox_probe(struct platform_device *pdev) GFP_KERNEL); if (!pcc_mbox_channels) { rc = -ENOMEM;
goto err;
}goto put_table;
chan_info = devm_kcalloc(dev, count, sizeof(*chan_info), GFP_KERNEL); if (!chan_info) { rc = -ENOMEM;
goto err;
}goto put_table;
pcc_mbox_ctrl = devm_kzalloc(dev, sizeof(*pcc_mbox_ctrl), GFP_KERNEL); if (!pcc_mbox_ctrl) { rc = -ENOMEM;
goto err;
}goto put_table;
/* Point to the first PCC subspace entry */ @@ -796,17 +796,17 @@ static int pcc_mbox_probe(struct platform_device *pdev) !pcc_mbox_ctrl->txdone_irq) { pr_err("Platform Interrupt flag must be set to 1"); rc = -EINVAL;
goto err;
}goto put_table;
if (pcc_mbox_ctrl->txdone_irq) { rc = pcc_parse_subspace_irq(pchan, pcct_entry); if (rc < 0)
goto err;
} rc = pcc_parse_subspace_db_reg(pchan, pcct_entry); if (rc < 0)goto put_table;
goto err;
goto put_table;
pcc_parse_subspace_shmem(pchan, pcct_entry); @@ -827,9 +827,8 @@ static int pcc_mbox_probe(struct platform_device *pdev) rc = mbox_controller_register(pcc_mbox_ctrl); if (rc) pr_err("Err registering PCC as Mailbox controller: %d\n", rc);
- else
return 0;
-err:
+put_table: acpi_put_table(pcct_tbl); return rc; }