From 4dd2158f3374882c7eb6257f2e0e1ba79e2c8e04 Mon Sep 17 00:00:00 2001 From: Ram Pai Date: Thu, 22 Sep 2011 15:48:58 +0800 Subject: [PATCH] --- yaml --- r: 264207 b: refs/heads/master c: 47ea91b4052d9e94b9dca5d7a3d947fbebd07ba9 h: refs/heads/master i: 264205: 8f9586b6c96405ea8141d0bca78c20e0b951408f 264203: 80ca64d2665ea4ed7a5571723785b187cd3c5d2f 264199: 61a677293567fffa72cc3e29ccd97d39c6d6b5b2 264191: b06abeac2fa90f9f53360782482ff97009c3ba8d v: v3 --- [refs] | 2 +- trunk/kernel/resource.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 4668caab0879..dfcac76d3238 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 92bb062fe36132a04c6dc8b3c51c945730b05224 +refs/heads/master: 47ea91b4052d9e94b9dca5d7a3d947fbebd07ba9 diff --git a/trunk/kernel/resource.c b/trunk/kernel/resource.c index 3b3cedc52592..c8dc249da5ce 100644 --- a/trunk/kernel/resource.c +++ b/trunk/kernel/resource.c @@ -419,6 +419,9 @@ static int __find_resource(struct resource *root, struct resource *old, else tmp.end = root->end; + if (tmp.end < tmp.start) + goto next; + resource_clip(&tmp, constraint->min, constraint->max); arch_remove_reservations(&tmp); @@ -436,8 +439,10 @@ static int __find_resource(struct resource *root, struct resource *old, return 0; } } - if (!this) + +next: if (!this || this->end == root->end) break; + if (this != old) tmp.start = this->end + 1; this = this->sibling;