summaryrefslogtreecommitdiff
path: root/kernel/resource.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-10-20 12:59:19 (GMT)
committerArnd Bergmann <arnd@arndb.de>2011-10-20 12:59:19 (GMT)
commit2f540738f8d228016c6cd0d3b303896c174ecee3 (patch)
tree7e6574c041ac4386763f94d3d401d70f4ab6f55b /kernel/resource.c
parenta3849a4c038a21075a0bc7eaf37f65a93976d10c (diff)
parentd8e9c00e38f6947cef7f5466a0a3d369461ab97f (diff)
downloadlinux-fsl-qoriq-2f540738f8d228016c6cd0d3b303896c174ecee3.tar.xz
Merge branch 'tegra/cleanup' into next/cleanup
Diffstat (limited to 'kernel/resource.c')
-rw-r--r--kernel/resource.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 3b3cedc..c8dc249 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;