diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 877ca046f43..86ce9a526c1 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -2378,7 +2378,7 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | |||
2378 | vms = kzalloc(sizeof(vms[0]) * nr_vms, GFP_KERNEL); | 2378 | vms = kzalloc(sizeof(vms[0]) * nr_vms, GFP_KERNEL); |
2379 | vas = kzalloc(sizeof(vas[0]) * nr_vms, GFP_KERNEL); | 2379 | vas = kzalloc(sizeof(vas[0]) * nr_vms, GFP_KERNEL); |
2380 | if (!vas || !vms) | 2380 | if (!vas || !vms) |
2381 | goto err_free; | 2381 | goto err_free2; |
2382 | 2382 | ||
2383 | for (area = 0; area < nr_vms; area++) { | 2383 | for (area = 0; area < nr_vms; area++) { |
2384 | vas[area] = kzalloc(sizeof(struct vmap_area), GFP_KERNEL); | 2384 | vas[area] = kzalloc(sizeof(struct vmap_area), GFP_KERNEL); |
@@ -2476,11 +2476,10 @@ found: | |||
2476 | 2476 | ||
2477 | err_free: | 2477 | err_free: |
2478 | for (area = 0; area < nr_vms; area++) { | 2478 | for (area = 0; area < nr_vms; area++) { |
2479 | if (vas) | 2479 | kfree(vas[area]); |
2480 | kfree(vas[area]); | 2480 | kfree(vms[area]); |
2481 | if (vms) | ||
2482 | kfree(vms[area]); | ||
2483 | } | 2481 | } |
2482 | err_free2: | ||
2484 | kfree(vas); | 2483 | kfree(vas); |
2485 | kfree(vms); | 2484 | kfree(vms); |
2486 | return NULL; | 2485 | return NULL; |