[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87a513bd-096c-45ab-8f5f-a8d3d6ad6b2e@suswa.mountain>
Date: Thu, 19 Jun 2025 17:30:26 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Zhe Qiao <qiaozhe@...as.ac.cn>
Cc: rafael@...nel.org, bhelgaas@...gle.com, helgaas@...nel.org,
lenb@...nel.org, kwilczynski@...nel.org, sashal@...nel.org,
linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Revert "PCI/ACPI: Fix allocated memory release on error
in pci_acpi_scan_root()"
On Thu, Jun 19, 2025 at 03:26:08PM +0800, Zhe Qiao wrote:
> This reverts commit 631b2af2f35737750af284be22e63da56bf20139.
>
> The reverted patch causes the 'ri->cfg' and 'root_ops' resources to be
> released multiple times.
>
> When acpi_pci_root_create() fails, these resources have already been
> released internally by the __acpi_pci_root_release_info() function.
> Releasing them again in pci_acpi_scan_root() leads to incorrect behavior
> and potential memory issues.
>
> We plan to resolve the issue using a more appropriate fix.
>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/all/aEmdnuw715btq7Q5@stanley.mountain/
> Cc: Dan Carpenter <dan.carpenter@...aro.org>
> Signed-off-by: Zhe Qiao <qiaozhe@...as.ac.cn>
Acked-by: Dan Carpenter <dan.carpenter@...aro.org>
Reverting is probably the simplest option. There is still an issue in
the code where in acpi_pci_root_create() the goto out_release_info
doesn't free sysdata except on the last goto. So there is a small
leak. But it's probably more theoretical than real.
regards,
dan carpenter
Powered by blists - more mailing lists