diff options
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 124e794867c5..519f9db063ff 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -96,10 +96,16 @@ void mem_hotplug_done(void) | |||
96 | cpus_read_unlock(); | 96 | cpus_read_unlock(); |
97 | } | 97 | } |
98 | 98 | ||
99 | u64 max_mem_size = U64_MAX; | ||
100 | |||
99 | /* add this memory to iomem resource */ | 101 | /* add this memory to iomem resource */ |
100 | static struct resource *register_memory_resource(u64 start, u64 size) | 102 | static struct resource *register_memory_resource(u64 start, u64 size) |
101 | { | 103 | { |
102 | struct resource *res, *conflict; | 104 | struct resource *res, *conflict; |
105 | |||
106 | if (start + size > max_mem_size) | ||
107 | return ERR_PTR(-E2BIG); | ||
108 | |||
103 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); | 109 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
104 | if (!res) | 110 | if (!res) |
105 | return ERR_PTR(-ENOMEM); | 111 | return ERR_PTR(-ENOMEM); |