]> Pileus Git - ~andy/linux/blobdiff - mm/vmalloc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[~andy/linux] / mm / vmalloc.c
index 83625b6fcc3605e63e5a524cda75d2f18256715c..0536dde139d1e1f6f28fc93ccd05a9fc337e2c7e 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;