mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
cxl: Free virtual PHB when removing
When adding a vPHB in cxl_pci_vphb_add(), we allocate a pci_controller struct using pcibios_alloc_controller(). However, we don't free it in cxl_pci_vphb_remove(), causing a leak. Call pcibios_free_controller() in cxl_pci_vphb_remove() to free the vPHB data structure correctly. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
6b8b252f40
commit
2e1a2556eb
1 changed files with 2 additions and 0 deletions
|
@ -290,8 +290,10 @@ void cxl_pci_vphb_remove(struct cxl_afu *afu)
|
|||
return;
|
||||
|
||||
phb = afu->phb;
|
||||
afu->phb = NULL;
|
||||
|
||||
pci_remove_root_bus(phb->bus);
|
||||
pcibios_free_controller(phb);
|
||||
}
|
||||
|
||||
struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev)
|
||||
|
|
Loading…
Reference in a new issue