1
0
Fork 0

m68k/PCI: Fix a memory leak in an error handling path

[ Upstream commit c3f4ec050f ]

If 'ioremap' fails, we must free 'bridge', as done in other error handling
path bellow.

Fixes: 19cc4c843f ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Christophe JAILLET 2020-04-18 09:07:51 +02:00 committed by Greg Kroah-Hartman
parent ec475f960e
commit 02bdd58140
1 changed files with 3 additions and 1 deletions

View File

@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
/* Keep a virtual mapping to IO/config space active */
iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
if (iospace == 0)
if (iospace == 0) {
pci_free_host_bridge(bridge);
return -ENODEV;
}
pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
(u32) iospace);