diff options
-rw-r--r-- | arch/i386/mm/ioremap.c | 2 | ||||
-rw-r--r-- | include/linux/vmalloc.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c index fff08ae7b5ed..0b278315d737 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/i386/mm/ioremap.c | |||
@@ -196,7 +196,7 @@ void iounmap(volatile void __iomem *addr) | |||
196 | /* Reset the direct mapping. Can block */ | 196 | /* Reset the direct mapping. Can block */ |
197 | if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { | 197 | if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { |
198 | change_page_attr(virt_to_page(__va(p->phys_addr)), | 198 | change_page_attr(virt_to_page(__va(p->phys_addr)), |
199 | p->size >> PAGE_SHIFT, | 199 | get_vm_area_size(p) >> PAGE_SHIFT, |
200 | PAGE_KERNEL); | 200 | PAGE_KERNEL); |
201 | global_flush_tlb(); | 201 | global_flush_tlb(); |
202 | } | 202 | } |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index c2b10cae5da5..89338b468d0d 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -58,6 +58,13 @@ void vmalloc_sync_all(void); | |||
58 | /* | 58 | /* |
59 | * Lowlevel-APIs (not for driver use!) | 59 | * Lowlevel-APIs (not for driver use!) |
60 | */ | 60 | */ |
61 | |||
62 | static inline size_t get_vm_area_size(const struct vm_struct *area) | ||
63 | { | ||
64 | /* return actual size without guard page */ | ||
65 | return area->size - PAGE_SIZE; | ||
66 | } | ||
67 | |||
61 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | 68 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); |
62 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 69 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
63 | unsigned long start, unsigned long end); | 70 | unsigned long start, unsigned long end); |