]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pci_iounmap(): Fix MMIO mapping leak
authorPhilipp Stanner <pstanner@redhat.com>
Wed, 31 Jan 2024 09:00:20 +0000 (10:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:07 +0000 (15:11 +0200)
commitf3749345a9b7295dd071d0ed589634cb46364f77
tree1f5c331e22cca437ae1bc01260db0388bd114ba7
parent104a5b2772bc7c0715ae7355ccf9d294a472765c
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>
lib/pci_iomap.c