PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root()
authorZhe Qiao <qiaozhe@iscas.ac.cn>
Wed, 30 Apr 2025 06:06:03 +0000 (14:06 +0800)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Thu, 22 May 2025 11:00:03 +0000 (11:00 +0000)
commit631b2af2f35737750af284be22e63da56bf20139
treecc5b7bdc59559230fe4ab731aa834ef4bfa5349a
parent0af2f6be1b4281385b618cb86ad946eded089ac8
PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root()

In the pci_acpi_scan_root() function, when creating a PCI bus fails,
we need to free up the previously allocated memory, which can avoid
invalid memory usage and save resources.

Fixes: 789befdfa389 ("arm64: PCI: Migrate ACPI related functions to pci-acpi.c")
Signed-off-by: Zhe Qiao <qiaozhe@iscas.ac.cn>
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20250430060603.381504-1-qiaozhe@iscas.ac.cn
drivers/pci/pci-acpi.c