summaryrefslogtreecommitdiff
path: root/kernel/resource.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-05-02 13:38:40 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-05-02 13:38:40 -0700
commit9da06237e8cbb2f20a35adf23af8c7bb3b245804 (patch)
treef65b0944b4f3fe43070f3a10676fe2062456b007 /kernel/resource.c
parent6fa93fc89f5e5641c0ad1be533b016e065cbf04d (diff)
parentee76c85f715377aec3b0115e48b7d66a726ffdea (diff)
Merge "Merge android-4.4.129 (b1c4836) into msm-4.4"
Diffstat (limited to 'kernel/resource.c')
-rw-r--r--kernel/resource.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index c09d484f7b5f..73348f574163 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -611,7 +611,8 @@ static int __find_resource(struct resource *root, struct resource *old,
alloc.start = constraint->alignf(constraint->alignf_data, &avail,
size, constraint->align);
alloc.end = alloc.start + size - 1;
- if (resource_contains(&avail, &alloc)) {
+ if (alloc.start <= alloc.end &&
+ resource_contains(&avail, &alloc)) {
new->start = alloc.start;
new->end = alloc.end;
return 0;