aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <[email protected]>2020-01-21 18:36:59 +0000
committerGreg Kroah-Hartman <[email protected]>2020-01-21 18:36:59 +0000
commitdd7d99dc688d0fc448976f52f8517fbdeccdccda (patch)
tree4ad59de5d584cf03e772ee153260c24ba0d717bd /mm/sparse.c
parentphy: ti: j721e-wiz: Fix build error without CONFIG_OF_ADDRESS (diff)
parentLinux 5.5-rc7 (diff)
downloadkernel-dd7d99dc688d0fc448976f52f8517fbdeccdccda.tar.gz
kernel-dd7d99dc688d0fc448976f52f8517fbdeccdccda.zip
Merge 5.5-rc7 into usb-next
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index b20ab7cdac86..3822ecbd8a1f 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -777,7 +777,14 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages,
if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) {
unsigned long section_nr = pfn_to_section_nr(pfn);
- if (!section_is_early) {
+ /*
+ * When removing an early section, the usage map is kept (as the
+ * usage maps of other sections fall into the same page). It
+ * will be re-used when re-adding the section - which is then no
+ * longer an early section. If the usage map is PageReserved, it
+ * was allocated during boot.
+ */
+ if (!PageReserved(virt_to_page(ms->usage))) {
kfree(ms->usage);
ms->usage = NULL;
}