]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/vmalloc.c
ACPI: drivers/acpi: elide a non-zero test on a result that is never 0
[linux-2.6-omap-h63xx.git] / mm / vmalloc.c
index 83625b6fcc3605e63e5a524cda75d2f18256715c..ecf91f8034bf0e8cb2c3effb63609fd3c8405cdb 100644 (file)
@@ -254,6 +254,10 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long fl
                if (addr > end - size)
                        goto out;
        }
+       if ((size + addr) < addr)
+               goto out;
+       if (addr > end - size)
+               goto out;
 
 found:
        area->next = *p;
@@ -463,8 +467,8 @@ void *vmap(struct page **pages, unsigned int count,
 }
 EXPORT_SYMBOL(vmap);
 
-void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
-                               pgprot_t prot, int node)
+static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
+                                pgprot_t prot, int node)
 {
        struct page **pages;
        unsigned int nr_pages, array_size, i;
@@ -753,7 +757,8 @@ finished:
  *     @vma:           vma to cover (map full range of vma)
  *     @addr:          vmalloc memory
  *     @pgoff:         number of pages into addr before first page to map
- *     @returns:       0 for success, -Exxx on failure
+ *
+ *     Returns:        0 for success, -Exxx on failure
  *
  *     This function checks that addr is a valid vmalloc'ed area, and
  *     that it is big enough to cover the vma. Will return failure if
@@ -816,7 +821,7 @@ void  __attribute__((weak)) vmalloc_sync_all(void)
 }
 
 
-static int f(pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
+static int f(pte_t *pte, pgtable_t table, unsigned long addr, void *data)
 {
        /* apply_to_page_range() does all the hard work. */
        return 0;
@@ -825,7 +830,8 @@ static int f(pte_t *pte, struct page *pmd_page, unsigned long addr, void *data)
 /**
  *     alloc_vm_area - allocate a range of kernel address space
  *     @size:          size of the area
- *     @returns:       NULL on failure, vm_struct on success
+ *
+ *     Returns:        NULL on failure, vm_struct on success
  *
  *     This function reserves a range of kernel address space, and
  *     allocates pagetables to map that range.  No actual mappings