aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ldt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/ldt.c')
-rw-r--r--arch/x86/kernel/ldt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index b8ef46270e24..8a7660c8394a 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -12,7 +12,6 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <linux/vmalloc.h> 14#include <linux/vmalloc.h>
15#include <linux/slab.h>
16 15
17#include <asm/uaccess.h> 16#include <asm/uaccess.h>
18#include <asm/system.h> 17#include <asm/system.h>
@@ -40,7 +39,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
40 if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE) 39 if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
41 newldt = vmalloc(mincount * LDT_ENTRY_SIZE); 40 newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
42 else 41 else
43 newldt = kmalloc(mincount * LDT_ENTRY_SIZE, GFP_KERNEL); 42 newldt = (void *)__get_free_page(GFP_KERNEL);
44 43
45 if (!newldt) 44 if (!newldt)
46 return -ENOMEM; 45 return -ENOMEM;
@@ -78,7 +77,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
78 if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE) 77 if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE)
79 vfree(oldldt); 78 vfree(oldldt);
80 else 79 else
81 kfree(oldldt); 80 put_page(virt_to_page(oldldt));
82 } 81 }
83 return 0; 82 return 0;
84} 83}
@@ -129,7 +128,7 @@ void destroy_context(struct mm_struct *mm)
129 if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE) 128 if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
130 vfree(mm->context.ldt); 129 vfree(mm->context.ldt);
131 else 130 else
132 kfree(mm->context.ldt); 131 put_page(virt_to_page(mm->context.ldt));
133 mm->context.size = 0; 132 mm->context.size = 0;
134 } 133 }
135} 134}