]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/sparse.c
hwmon: (nct6775) Fix potential Spectre v1
[mirror_ubuntu-bionic-kernel.git] / mm / sparse.c
index 7a5dacaa06e3f277c8543c502dba0e3c6a6a1a13..f73e6b9aa9fad9449b5efe79ed08e284fc14f1ac 100644 (file)
@@ -211,7 +211,7 @@ void __init memory_present(int nid, unsigned long start, unsigned long end)
        if (unlikely(!mem_section)) {
                unsigned long size, align;
 
-               size = sizeof(struct mem_section) * NR_SECTION_ROOTS;
+               size = sizeof(struct mem_section*) * NR_SECTION_ROOTS;
                align = 1 << (INTERNODE_CACHE_SHIFT);
                mem_section = memblock_virt_alloc(size, align);
        }
@@ -661,7 +661,7 @@ void offline_mem_sections(unsigned long start_pfn, unsigned long end_pfn)
        unsigned long pfn;
 
        for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
-               unsigned long section_nr = pfn_to_section_nr(start_pfn);
+               unsigned long section_nr = pfn_to_section_nr(pfn);
                struct mem_section *ms;
 
                /*