Merge branch 'akpm-current/current'
[deliverable/linux.git] / arch / x86 / kernel / e820.c
index d935983ff90eeaf49bf2962185e605ee9b2db2c4..a1b4da92921c75b053399880e5bcd0e9ce071e4e 100644 (file)
@@ -388,11 +388,11 @@ static int __init __append_e820_map(struct e820entry *biosmap, int nr_map)
        while (nr_map) {
                u64 start = biosmap->addr;
                u64 size = biosmap->size;
-               u64 end = start + size;
+               u64 end = start + size - 1;
                u32 type = biosmap->type;
 
                /* Overflow in 64 bits? Ignore the memory map. */
-               if (start > end)
+               if (start > end && likely(size))
                        return -1;
 
                e820_add_region(start, size, type);
This page took 0.024184 seconds and 5 git commands to generate.