diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-06 18:44:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-06 18:44:39 -0400 |
commit | dbd43d08642c037beb937c2670976c076120507b (patch) | |
tree | 4d44a4b54a731eb290e040345c38ed9e1e7ecc6a /kernel/resource.c | |
parent | c34c07d6946ec8969fa71ba03dbb95091f4eb9d3 (diff) | |
parent | 9f737633e6ee54fc174282d49b2559bd2208391d (diff) |
Merge branch 'master' of /home/greg/linux/git/torvalds-2.6/
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 0dd3a857579e..46286434af80 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -244,6 +244,7 @@ int find_next_system_ram(struct resource *res) | |||
244 | 244 | ||
245 | start = res->start; | 245 | start = res->start; |
246 | end = res->end; | 246 | end = res->end; |
247 | BUG_ON(start >= end); | ||
247 | 248 | ||
248 | read_lock(&resource_lock); | 249 | read_lock(&resource_lock); |
249 | for (p = iomem_resource.child; p ; p = p->sibling) { | 250 | for (p = iomem_resource.child; p ; p = p->sibling) { |
@@ -254,15 +255,17 @@ int find_next_system_ram(struct resource *res) | |||
254 | p = NULL; | 255 | p = NULL; |
255 | break; | 256 | break; |
256 | } | 257 | } |
257 | if (p->start >= start) | 258 | if ((p->end >= start) && (p->start < end)) |
258 | break; | 259 | break; |
259 | } | 260 | } |
260 | read_unlock(&resource_lock); | 261 | read_unlock(&resource_lock); |
261 | if (!p) | 262 | if (!p) |
262 | return -1; | 263 | return -1; |
263 | /* copy data */ | 264 | /* copy data */ |
264 | res->start = p->start; | 265 | if (res->start < p->start) |
265 | res->end = p->end; | 266 | res->start = p->start; |
267 | if (res->end > p->end) | ||
268 | res->end = p->end; | ||
266 | return 0; | 269 | return 0; |
267 | } | 270 | } |
268 | #endif | 271 | #endif |