Skip to content

Commit c3f4ec0

Browse files
tititiou36Greg Ungerer
authored andcommitted
m68k/PCI: Fix a memory leak in an error handling path
If 'ioremap' fails, we must free 'bridge', as done in other error handling path bellow. Fixes: 19cc4c8 ("m68k/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent 9cb1fd0 commit c3f4ec0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/m68k/coldfire/pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ static int __init mcf_pci_init(void)
216216

217217
/* Keep a virtual mapping to IO/config space active */
218218
iospace = (unsigned long) ioremap(PCI_IO_PA, PCI_IO_SIZE);
219-
if (iospace == 0)
219+
if (iospace == 0) {
220+
pci_free_host_bridge(bridge);
220221
return -ENODEV;
222+
}
221223
pr_info("Coldfire: PCI IO/config window mapped to 0x%x\n",
222224
(u32) iospace);
223225

0 commit comments

Comments
 (0)