[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240131090023.12331-2-pstanner@redhat.com>
Date: Wed, 31 Jan 2024 10:00:20 +0100
From: Philipp Stanner <pstanner@...hat.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
Arnd Bergmann <arnd@...db.de>,
Johannes Berg <johannes@...solutions.net>,
Randy Dunlap <rdunlap@...radead.org>,
NeilBrown <neilb@...e.de>,
John Sanpe <sanpeqf@...il.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Philipp Stanner <pstanner@...hat.com>,
Dave Jiang <dave.jiang@...el.com>,
Uladzislau Koshchanka <koshchanka@...il.com>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
David Gow <davidgow@...gle.com>,
Kees Cook <keescook@...omium.org>,
Rae Moar <rmoar@...gle.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
"wuqiang.matt" <wuqiang.matt@...edance.com>,
Yury Norov <yury.norov@...il.com>,
Jason Baron <jbaron@...mai.com>,
Thomas Gleixner <tglx@...utronix.de>,
Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ben Dooks <ben.dooks@...ethink.co.uk>,
dakr@...hat.com
Cc: linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org,
linux-arch@...r.kernel.org,
stable@...r.kernel.org,
Arnd Bergmann <arnd@...nel.org>
Subject: [PATCH v6 1/4] lib/pci_iomap.c: fix cleanup bug in pci_iounmap()
The #ifdef for the ioport-ranges accidentally also guards iounmap(),
potentially compiling an empty function. This would cause the mapping to
be leaked.
Move the guard so that iounmap() will always be part of the function.
CC: <stable@...r.kernel.org> # v5.15+
Fixes: 316e8d79a095 ("pci_iounmap'2: Electric Boogaloo: try to make sense of it all")
Reported-by: Danilo Krummrich <dakr@...hat.com>
Suggested-by: Arnd Bergmann <arnd@...nel.org>
Signed-off-by: Philipp Stanner <pstanner@...hat.com>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
---
lib/pci_iomap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.43.0
Powered by blists - more mailing lists