diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-14 02:06:31 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-14 02:06:31 -0500 |
commit | c488a4731abb53aa1bab9fccd8a7472083159bfd (patch) | |
tree | db6d4a664a1e4b7685c1d2d79da63263f40adf7b /arch/x86/kernel/module.c | |
parent | 6d2ae89c36e2adab5cfa69fecb11290082817ac6 (diff) | |
parent | bba958783b1b4cb0a9420f4e11082467132a334c (diff) |
Merge branch 'common/mmcif' into rmobile-latest
Diffstat (limited to 'arch/x86/kernel/module.c')
-rw-r--r-- | arch/x86/kernel/module.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index 8f2956091735..ab23f1ad4bf1 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
@@ -37,20 +37,11 @@ | |||
37 | 37 | ||
38 | void *module_alloc(unsigned long size) | 38 | void *module_alloc(unsigned long size) |
39 | { | 39 | { |
40 | struct vm_struct *area; | 40 | if (PAGE_ALIGN(size) > MODULES_LEN) |
41 | |||
42 | if (!size) | ||
43 | return NULL; | ||
44 | size = PAGE_ALIGN(size); | ||
45 | if (size > MODULES_LEN) | ||
46 | return NULL; | 41 | return NULL; |
47 | 42 | return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, | |
48 | area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); | 43 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, |
49 | if (!area) | 44 | -1, __builtin_return_address(0)); |
50 | return NULL; | ||
51 | |||
52 | return __vmalloc_area(area, GFP_KERNEL | __GFP_HIGHMEM, | ||
53 | PAGE_KERNEL_EXEC); | ||
54 | } | 45 | } |
55 | 46 | ||
56 | /* Free memory returned from module_alloc */ | 47 | /* Free memory returned from module_alloc */ |