---
kernel/resource.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
===================================================================
@@ -1130,7 +1130,9 @@ int probe_resource(struct resource *b_re
/* Probe extended range above top */
memset(busn_res, 0, sizeof(struct resource));
parent_res = b_res;
- while (parent_res && !(parent_res->flags & stop_flags)) {
+ while (!(parent_res->flags & stop_flags)) {
+ struct resource *up_parent_res;
+
ret = __adjust_resource(parent_res, parent_res->start,
resource_size(parent_res) + (needed_size - n_size));
if (!ret) {
@@ -1151,7 +1153,11 @@ int probe_resource(struct resource *b_re
/* ret must be 0 here*/
goto out;
}
- parent_res = parent_res->parent;
+ /* before go up, need to make sure at the same end */
+ up_parent_res = parent_res->parent;
+ if (!up_parent_res || up_parent_res->end != parent_res->end)
+ goto out;
+ parent_res = up_parent_res;
}
out: