Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316425
b: refs/heads/master
c: 82ec90e
h: refs/heads/master
i:
  316423: aedaf49
v: v3
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Jun 13, 2012
1 parent 4a7a494 commit 34414e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5cc62c202211096ec26309722ec27455d52c8726
refs/heads/master: 82ec90eac304e81b1389175b4dded7abecc678ef
13 changes: 8 additions & 5 deletions trunk/kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,14 +722,12 @@ int adjust_resource(struct resource *res, resource_size_t start, resource_size_t

write_lock(&resource_lock);

if (!parent)
goto skip;

if ((start < parent->start) || (end > parent->end))
goto out;

for (tmp = res->child; tmp; tmp = tmp->sibling) {
if ((tmp->start < start) || (tmp->end > end))
goto out;
}

if (res->sibling && (res->sibling->start <= end))
goto out;

Expand All @@ -741,6 +739,11 @@ int adjust_resource(struct resource *res, resource_size_t start, resource_size_t
goto out;
}

skip:
for (tmp = res->child; tmp; tmp = tmp->sibling)
if ((tmp->start < start) || (tmp->end > end))
goto out;

res->start = start;
res->end = end;
result = 0;
Expand Down

0 comments on commit 34414e2

Please sign in to comment.