diff options
-rw-r--r-- | drivers/hv/vmbus_drv.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index f123bca77808..328e4c3808e0 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c | |||
@@ -1063,12 +1063,28 @@ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx) | |||
1063 | new_res->start = start; | 1063 | new_res->start = start; |
1064 | new_res->end = end; | 1064 | new_res->end = end; |
1065 | 1065 | ||
1066 | /* | ||
1067 | * Stick ranges from higher in address space at the front of the list. | ||
1068 | * If two ranges are adjacent, merge them. | ||
1069 | */ | ||
1066 | do { | 1070 | do { |
1067 | if (!*old_res) { | 1071 | if (!*old_res) { |
1068 | *old_res = new_res; | 1072 | *old_res = new_res; |
1069 | break; | 1073 | break; |
1070 | } | 1074 | } |
1071 | 1075 | ||
1076 | if (((*old_res)->end + 1) == new_res->start) { | ||
1077 | (*old_res)->end = new_res->end; | ||
1078 | kfree(new_res); | ||
1079 | break; | ||
1080 | } | ||
1081 | |||
1082 | if ((*old_res)->start == new_res->end + 1) { | ||
1083 | (*old_res)->start = new_res->start; | ||
1084 | kfree(new_res); | ||
1085 | break; | ||
1086 | } | ||
1087 | |||
1072 | if ((*old_res)->end < new_res->start) { | 1088 | if ((*old_res)->end < new_res->start) { |
1073 | new_res->sibling = *old_res; | 1089 | new_res->sibling = *old_res; |
1074 | if (prev_res) | 1090 | if (prev_res) |