diff options
author | Philipp Stanner <pstanner@redhat.com> | 2024-01-31 10:00:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 15:28:17 +0200 |
commit | b5d40f02e7222da032c2042aebcf2a07de9b342f (patch) | |
tree | 4d673137b456bdb3baf6bccb7fc53991b8155135 /lib | |
parent | 86cb706a40b7e6b2221ee49a298a65ad9b46c02d (diff) | |
download | linux-b5d40f02e7222da032c2042aebcf2a07de9b342f.tar.gz linux-b5d40f02e7222da032c2042aebcf2a07de9b342f.tar.bz2 linux-b5d40f02e7222da032c2042aebcf2a07de9b342f.zip |
pci_iounmap(): Fix MMIO mapping leak
[ Upstream commit 7626913652cc786c238e2dd7d8740b17d41b2637 ]
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: 316e8d79a095 ("pci_iounmap'2: Electric Boogaloo: try to make sense of it all")
Link: https://lore.kernel.org/r/20240131090023.12331-2-pstanner@redhat.com
Reported-by: Danilo Krummrich <dakr@redhat.com>
Suggested-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: <stable@vger.kernel.org> # v5.15+
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pci_iomap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c index ce39ce9f3526..2829ddb0e316 100644 --- a/lib/pci_iomap.c +++ b/lib/pci_iomap.c @@ -170,8 +170,8 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *p) if (addr >= start && addr < start + IO_SPACE_LIMIT) return; - iounmap(p); #endif + iounmap(p); } EXPORT_SYMBOL(pci_iounmap); |