mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
LoongArch: Fix memleak in pci_acpi_scan_root()
[ 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@uniontech.com> Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0b700d29eb
commit
1215e29918
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue