Commit 5016c3a3 authored by Wentao Guan's avatar Wentao Guan Committed by Huacai Chen

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: default avatarYuli Wang <wangyuli@uniontech.com>
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
parent d4f31acf
...@@ -225,6 +225,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) ...@@ -225,6 +225,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
if (bus) { if (bus) {
memcpy(bus->sysdata, info->cfg, sizeof(struct pci_config_window)); memcpy(bus->sysdata, info->cfg, sizeof(struct pci_config_window));
kfree(info); kfree(info);
kfree(root_ops);
} else { } else {
struct pci_bus *child; struct pci_bus *child;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment