Skip to content

Commit 5016c3a

Browse files
opsiffchenhuacai
authored andcommitted
LoongArch: Fix memleak in pci_acpi_scan_root()
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@uniontech.com> Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent d4f31ac commit 5016c3a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/loongarch/pci/acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
225225
if (bus) {
226226
memcpy(bus->sysdata, info->cfg, sizeof(struct pci_config_window));
227227
kfree(info);
228+
kfree(root_ops);
228229
} else {
229230
struct pci_bus *child;
230231

0 commit comments

Comments
 (0)