[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241004181828.3669209-58-sashal@kernel.org>
Date: Fri, 4 Oct 2024 14:17:15 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Wentao Guan <guanwentao@...ontech.com>,
Yuli Wang <wangyuli@...ontech.com>,
Huacai Chen <chenhuacai@...ngson.cn>,
Sasha Levin <sashal@...nel.org>,
chenhuacai@...nel.org,
loongarch@...ts.linux.dev
Subject: [PATCH AUTOSEL 6.11 58/76] LoongArch: Fix memleak in pci_acpi_scan_root()
From: Wentao Guan <guanwentao@...ontech.com>
[ Upstream commit 5016c3a31a6d74eaf2fdfdec673eae8fcf90379e ]
Add kfree(root_ops) in this case to avoid memleak of root_ops,
leaks when pci_find_bus() != 0.
Signed-off-by: Yuli Wang <wangyuli@...ontech.com>
Signed-off-by: Wentao Guan <guanwentao@...ontech.com>
Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
arch/loongarch/pci/acpi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c
index 365f7de771cbb..1da4dc46df43e 100644
--- a/arch/loongarch/pci/acpi.c
+++ b/arch/loongarch/pci/acpi.c
@@ -225,6 +225,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
if (bus) {
memcpy(bus->sysdata, info->cfg, sizeof(struct pci_config_window));
kfree(info);
+ kfree(root_ops);
} else {
struct pci_bus *child;
--
2.43.0
Powered by blists - more mailing lists