[PATCH] memory hotadd fixes: change find_next_system_ram's return value manner
[linux-drm-fsl-dcu.git] / kernel / resource.c
index 0dd3a857579e4fe1b9aae9463aac4717e149eaa9..63e879379dbdafc5679421ac9c6095b4603de144 100644 (file)
@@ -261,8 +261,10 @@ int find_next_system_ram(struct resource *res)
        if (!p)
                return -1;
        /* copy data */
-       res->start = p->start;
-       res->end = p->end;
+       if (res->start < p->start)
+               res->start = p->start;
+       if (res->end > p->end)
+               res->end = p->end;
        return 0;
 }
 #endif