diff options
author | Wentao Guan <guanwentao@uniontech.com> | 2024-09-24 15:32:20 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-09-24 15:32:20 +0800 |
commit | 5016c3a31a6d74eaf2fdfdec673eae8fcf90379e (patch) | |
tree | 3588ee06fb8900fc73ec3bd683805d896e925f9b /arch/loongarch/pci/acpi.c | |
parent | d4f31acf1302088a5b16d1e4de890729acfa9638 (diff) |
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>
Diffstat (limited to 'arch/loongarch/pci/acpi.c')
-rw-r--r-- | arch/loongarch/pci/acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/loongarch/pci/acpi.c b/arch/loongarch/pci/acpi.c index 365f7de771cb..1da4dc46df43 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; |