diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 35f293816294..bba06c41fc59 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -180,6 +180,13 @@ struct page *vmalloc_to_page(const void *vmalloc_addr) | |||
180 | pmd_t *pmd; | 180 | pmd_t *pmd; |
181 | pte_t *ptep, pte; | 181 | pte_t *ptep, pte; |
182 | 182 | ||
183 | /* | ||
184 | * XXX we might need to change this if we add VIRTUAL_BUG_ON for | ||
185 | * architectures that do not vmalloc module space | ||
186 | */ | ||
187 | VIRTUAL_BUG_ON(!is_vmalloc_addr(vmalloc_addr) && | ||
188 | !is_module_address(addr)); | ||
189 | |||
183 | if (!pgd_none(*pgd)) { | 190 | if (!pgd_none(*pgd)) { |
184 | pud = pud_offset(pgd, addr); | 191 | pud = pud_offset(pgd, addr); |
185 | if (!pud_none(*pud)) { | 192 | if (!pud_none(*pud)) { |
@@ -381,16 +388,14 @@ static void __vunmap(const void *addr, int deallocate_pages) | |||
381 | return; | 388 | return; |
382 | 389 | ||
383 | if ((PAGE_SIZE-1) & (unsigned long)addr) { | 390 | if ((PAGE_SIZE-1) & (unsigned long)addr) { |
384 | printk(KERN_ERR "Trying to vfree() bad address (%p)\n", addr); | 391 | WARN(1, KERN_ERR "Trying to vfree() bad address (%p)\n", addr); |
385 | WARN_ON(1); | ||
386 | return; | 392 | return; |
387 | } | 393 | } |
388 | 394 | ||
389 | area = remove_vm_area(addr); | 395 | area = remove_vm_area(addr); |
390 | if (unlikely(!area)) { | 396 | if (unlikely(!area)) { |
391 | printk(KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", | 397 | WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", |
392 | addr); | 398 | addr); |
393 | WARN_ON(1); | ||
394 | return; | 399 | return; |
395 | } | 400 | } |
396 | 401 | ||