Skip to content

Commit 7626913

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
pci_iounmap(): Fix MMIO mapping leak
The #ifdef ARCH_HAS_GENERIC_IOPORT_MAP accidentally also guards iounmap(), which means MMIO mappings are leaked. Move the guard so we call iounmap() for MMIO mappings. Fixes: 316e8d7 ("pci_iounmap'2: Electric Boogaloo: try to make sense of it all") Link: https://lore.kernel.org/r/[email protected] Reported-by: Danilo Krummrich <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Cc: <[email protected]> # v5.15+
1 parent 6613476 commit 7626913

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/pci_iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p)
170170

171171
if (addr >= start && addr < start + IO_SPACE_LIMIT)
172172
return;
173-
iounmap(p);
174173
#endif
174+
iounmap(p);
175175
}
176176
EXPORT_SYMBOL(pci_iounmap);
177177

0 commit comments

Comments
 (0)