All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tracing: Do not call kmem_cache_free() on allocation failure
@ 2013-06-07  6:07 Namhyung Kim
  2013-06-07 19:53 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Namhyung Kim @ 2013-06-07  6:07 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Frederic Weisbecker, LKML, Namhyung Kim

From: Namhyung Kim <namhyung.kim@lge.com>

There's no point calling it when _alloc() failed.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 kernel/trace/trace_events.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 27963e2bf4bf..bb4950b552b5 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -97,7 +97,7 @@ static int __trace_define_field(struct list_head *head, const char *type,
 
 	field = kmem_cache_alloc(field_cachep, GFP_TRACE);
 	if (!field)
-		goto err;
+		return -ENOMEM;
 
 	field->name = name;
 	field->type = type;
@@ -114,11 +114,6 @@ static int __trace_define_field(struct list_head *head, const char *type,
 	list_add(&field->link, head);
 
 	return 0;
-
-err:
-	kmem_cache_free(field_cachep, field);
-
-	return -ENOMEM;
 }
 
 int trace_define_field(struct ftrace_event_call *call, const char *type,
-- 
1.7.11.7


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

* Re: [PATCH] tracing: Do not call kmem_cache_free() on allocation failure
  2013-06-07  6:07 [PATCH] tracing: Do not call kmem_cache_free() on allocation failure Namhyung Kim
@ 2013-06-07 19:53 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2013-06-07 19:53 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Frederic Weisbecker, LKML, Namhyung Kim

On Fri, 2013-06-07 at 15:07 +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
> 
> There's no point calling it when _alloc() failed.

Thanks, I queued this up for 3.11 as it's not that important for a late
-rc release.

-- Steve

> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  kernel/trace/trace_events.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 27963e2bf4bf..bb4950b552b5 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -97,7 +97,7 @@ static int __trace_define_field(struct list_head *head, const char *type,
>  
>  	field = kmem_cache_alloc(field_cachep, GFP_TRACE);
>  	if (!field)
> -		goto err;
> +		return -ENOMEM;
>  
>  	field->name = name;
>  	field->type = type;
> @@ -114,11 +114,6 @@ static int __trace_define_field(struct list_head *head, const char *type,
>  	list_add(&field->link, head);
>  
>  	return 0;
> -
> -err:
> -	kmem_cache_free(field_cachep, field);
> -
> -	return -ENOMEM;
>  }
>  
>  int trace_define_field(struct ftrace_event_call *call, const char *type,



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

end of thread, other threads:[~2013-06-07 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-07  6:07 [PATCH] tracing: Do not call kmem_cache_free() on allocation failure Namhyung Kim
2013-06-07 19:53 ` Steven Rostedt

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.