mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
Merge branch 'pci/controller/xilinx'
- Fix IRQ domain leak when MSI allocation fails (Haotian Zhang) * pci/controller/xilinx: PCI: xilinx: Fix INTx IRQ domain leak in error paths
This commit is contained in:
commit
f4e40035d7
1 changed files with 6 additions and 3 deletions
|
|
@ -302,9 +302,10 @@ static int xilinx_allocate_msi_domains(struct xilinx_pcie *pcie)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void xilinx_free_msi_domains(struct xilinx_pcie *pcie)
|
||||
static void xilinx_free_irq_domains(struct xilinx_pcie *pcie)
|
||||
{
|
||||
irq_domain_remove(pcie->msi_domain);
|
||||
irq_domain_remove(pcie->leg_domain);
|
||||
}
|
||||
|
||||
/* INTx Functions */
|
||||
|
|
@ -480,8 +481,10 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie *pcie)
|
|||
phys_addr_t pa = ALIGN_DOWN(virt_to_phys(pcie), SZ_4K);
|
||||
|
||||
ret = xilinx_allocate_msi_domains(pcie);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
irq_domain_remove(pcie->leg_domain);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pcie_write(pcie, upper_32_bits(pa), XILINX_PCIE_REG_MSIBASE1);
|
||||
pcie_write(pcie, lower_32_bits(pa), XILINX_PCIE_REG_MSIBASE2);
|
||||
|
|
@ -600,7 +603,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
|
|||
|
||||
err = pci_host_probe(bridge);
|
||||
if (err)
|
||||
xilinx_free_msi_domains(pcie);
|
||||
xilinx_free_irq_domains(pcie);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue