diff options
| -rw-r--r-- | mm/vmalloc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a47e3894c775..fa409c9092be 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
| @@ -2482,7 +2482,7 @@ static unsigned long pvm_determine_end(struct vmap_area **pnext, | |||
| 2482 | * matching slot. While scanning, if any of the areas overlaps with | 2482 | * matching slot. While scanning, if any of the areas overlaps with |
| 2483 | * existing vmap_area, the base address is pulled down to fit the | 2483 | * existing vmap_area, the base address is pulled down to fit the |
| 2484 | * area. Scanning is repeated till all the areas fit and then all | 2484 | * area. Scanning is repeated till all the areas fit and then all |
| 2485 | * necessary data structres are inserted and the result is returned. | 2485 | * necessary data structures are inserted and the result is returned. |
| 2486 | */ | 2486 | */ |
| 2487 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | 2487 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, |
| 2488 | const size_t *sizes, int nr_vms, | 2488 | const size_t *sizes, int nr_vms, |
| @@ -2510,15 +2510,11 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | |||
| 2510 | if (start > offsets[last_area]) | 2510 | if (start > offsets[last_area]) |
| 2511 | last_area = area; | 2511 | last_area = area; |
| 2512 | 2512 | ||
| 2513 | for (area2 = 0; area2 < nr_vms; area2++) { | 2513 | for (area2 = area + 1; area2 < nr_vms; area2++) { |
| 2514 | unsigned long start2 = offsets[area2]; | 2514 | unsigned long start2 = offsets[area2]; |
| 2515 | unsigned long end2 = start2 + sizes[area2]; | 2515 | unsigned long end2 = start2 + sizes[area2]; |
| 2516 | 2516 | ||
| 2517 | if (area2 == area) | 2517 | BUG_ON(start2 < end && start < end2); |
| 2518 | continue; | ||
| 2519 | |||
| 2520 | BUG_ON(start2 >= start && start2 < end); | ||
| 2521 | BUG_ON(end2 <= end && end2 > start); | ||
| 2522 | } | 2518 | } |
| 2523 | } | 2519 | } |
| 2524 | last_end = offsets[last_area] + sizes[last_area]; | 2520 | last_end = offsets[last_area] + sizes[last_area]; |
