mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas()
Subsystems (3)
PATCH 1/1 mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas()
From: Markus Elfring <[email protected]>
Date: Tue, 16 Jun 2026 18:00:16 +0200
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.
Signed-off-by Markus Elfring <[email protected]>
--- mm/vmalloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mm/vmalloc.c +1 -3
@@ -5198,9 +5198,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; }/**
Signature · 1 line
2.54.0
Quoted 31 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Tue, 16 Jun 2026 18:00:16 +0200Use 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.
Signed-off-by Markus Elfring <[email protected]>--- mm/vmalloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mm/vmalloc.c +1
-3@@ -5198,9 +5198,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; }/** Signature · 1 line
2.54.0
More removing then adding!
Reviewed-by Uladzislau Rezki (Sony) <[email protected]>
--
Uladzislau Rezki