aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/mm/numa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index a828a01739cc..15b67d2760cb 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -53,6 +53,8 @@ static int __init populate_memnodemap(
53 int res = -1; 53 int res = -1;
54 unsigned long addr, end; 54 unsigned long addr, end;
55 55
56 if (shift >= 64)
57 return -1;
56 memset(memnodemap, 0xff, sizeof(memnodemap)); 58 memset(memnodemap, 0xff, sizeof(memnodemap));
57 for (i = 0; i < numnodes; i++) { 59 for (i = 0; i < numnodes; i++) {
58 addr = nodes[i].start; 60 addr = nodes[i].start;
@@ -65,7 +67,7 @@ static int __init populate_memnodemap(
65 if (memnodemap[addr >> shift] != 0xff) 67 if (memnodemap[addr >> shift] != 0xff)
66 return -1; 68 return -1;
67 memnodemap[addr >> shift] = i; 69 memnodemap[addr >> shift] = i;
68 addr += (1 << shift); 70 addr += (1UL << shift);
69 } while (addr < end); 71 } while (addr < end);
70 res = 1; 72 res = 1;
71 } 73 }