All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas()
@ 2026-06-16 16:14 Markus Elfring
  2026-06-16 17:35 ` Uladzislau Rezki
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2026-06-16 16:14 UTC (permalink / raw)
  To: Andrew Morton, Daniel Axtens, Uladzislau Rezki, kernel-janitors
  Cc: LKML, Alexander Potapenko, Dmitry Vyukov

From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 mm/vmalloc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 1afca3568b9b..21a890586fef 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -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;
 }
 
 /**
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas()
  2026-06-16 16:14 [PATCH] mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas() Markus Elfring
@ 2026-06-16 17:35 ` Uladzislau Rezki
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzislau Rezki @ 2026-06-16 17:35 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Andrew Morton, Daniel Axtens, Uladzislau Rezki, kernel-janitors,
	LKML, Alexander Potapenko, Dmitry Vyukov

On Tue, Jun 16, 2026 at 06:14:52PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>
> ---
>  mm/vmalloc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 1afca3568b9b..21a890586fef 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -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;
>  }
>  
>  /**
> -- 
> 2.54.0
> 
More removing then adding!

Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

--
Uladzislau Rezki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-16 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16 16:14 [PATCH] mm/vmalloc: Use more common error handling code in pcpu_get_vm_areas() Markus Elfring
2026-06-16 17:35 ` Uladzislau Rezki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.