]> Pileus Git - ~andy/linux/blobdiff - mm/nommu.c
Merge tag 'iommu-updates-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / mm / nommu.c
index 298884dcd6e71e4723a203a82f1613cbfcec19ec..e44e6e0a125cb7148913f42fb8ff3e1587a49be9 100644 (file)
@@ -56,7 +56,6 @@
 void *high_memory;
 struct page *mem_map;
 unsigned long max_mapnr;
-unsigned long num_physpages;
 unsigned long highest_memmap_pfn;
 struct percpu_counter vm_committed_as;
 int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
@@ -85,7 +84,6 @@ unsigned long vm_memory_committed(void)
 EXPORT_SYMBOL_GPL(vm_memory_committed);
 
 EXPORT_SYMBOL(mem_map);
-EXPORT_SYMBOL(num_physpages);
 
 /* list of mapped, potentially shareable regions */
 static struct kmem_cache *vm_region_jar;
@@ -282,6 +280,10 @@ EXPORT_SYMBOL(vmalloc_to_pfn);
 
 long vread(char *buf, char *addr, unsigned long count)
 {
+       /* Don't allow overflow */
+       if ((unsigned long) buf + count < count)
+               count = -(unsigned long) buf;
+
        memcpy(buf, addr, count);
        return count;
 }