From 24e9b62985d8f40e72bf3b31ce908ae3c9547a67 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Tue, 16 Jun 2026 18:14:52 +0200 Subject: [PATCH] mm/vmalloc: use more common error handling code in pcpu_get_vm_areas() Use an existing label once more so that a bit of exception handling can be better reused at the end of this function implementation. This issue was detected by using the Coccinelle software. Link: https://lore.kernel.org/453375c4-c3ca-4e6f-8880-0e6ff3c74ee3@web.de Signed-off-by: Markus Elfring Reviewed-by: Uladzislau Rezki (Sony) Cc: Alexander Potapenko Cc: Daniel Axtens Cc: Dmitry Vyukov Signed-off-by: Andrew Morton --- mm/vmalloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 08f468135e4d..12f4a39fdd0b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -5199,9 +5199,7 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, kfree(vms[area]); } spin_unlock(&free_vmap_area_lock); - kfree(vas); - kfree(vms); - return NULL; + goto err_free2; } /**