]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/resource.c
[PATCH] memory hotadd fixes: find_next_system_ram catch range fix
[linux-2.6-omap-h63xx.git] / kernel / resource.c
index 63e879379dbdafc5679421ac9c6095b4603de144..46286434af8066af359143df81244e0c3024de19 100644 (file)
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res)
 
        start = res->start;
        end = res->end;
+       BUG_ON(start >= end);
 
        read_lock(&resource_lock);
        for (p = iomem_resource.child; p ; p = p->sibling) {
@@ -254,7 +255,7 @@ int find_next_system_ram(struct resource *res)
                        p = NULL;
                        break;
                }
-               if (p->start >= start)
+               if ((p->end >= start) && (p->start < end))
                        break;
        }
        read_unlock(&resource_lock);