From: Namhyung Kim Date: Fri, 7 Jun 2013 06:07:48 +0000 (+0900) Subject: tracing: Do not call kmem_cache_free() on allocation failure X-Git-Tag: firefly_0821_release~6453^2~1005 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b0cfaffa7e183719436a7a2b1b814afb5748c05c;p=firefly-linux-kernel-4.4.55.git tracing: Do not call kmem_cache_free() on allocation failure commit aaf6ac0f0871cb7fc0f28f3a00edf329bc7adc29 upstream. There's no point calling it when _alloc() failed. Link: http://lkml.kernel.org/r/1370585268-29169-1-git-send-email-namhyung@kernel.org Signed-off-by: Namhyung Kim Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 69532630a2d6..5f9a002d17d1 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -114,7 +114,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; @@ -131,11 +131,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,