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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;