X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=kernel%2Fresource.c;h=c8dc249da5ce6a9e8e90523006b24477a2355636;hb=dabcbb1bae0f55378060b285062b20f6ec648c6a;hp=3b3cedc52592164e11689375c4bb7d054df293cf;hpb=9ba365438a532436ecd96a089fb29b01516bed33;p=karo-tx-linux.git diff --git a/kernel/resource.c b/kernel/resource.c index 3b3cedc52592..c8dc249da5ce 100644 --- a/kernel/resource.c +++ b/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;