diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-06-07 02:07:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-29 12:47:31 -0400 |
commit | b0cfaffa7e183719436a7a2b1b814afb5748c05c (patch) | |
tree | 739355350e366ebcc49c302ce3b3a10e957d9a1e /kernel | |
parent | b460440f81f11175bdc657ee28a2421f8a02d209 (diff) |
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 <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_events.c | 7 |
1 files changed, 1 insertions, 6 deletions
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, | |||
114 | 114 | ||
115 | field = kmem_cache_alloc(field_cachep, GFP_TRACE); | 115 | field = kmem_cache_alloc(field_cachep, GFP_TRACE); |
116 | if (!field) | 116 | if (!field) |
117 | goto err; | 117 | return -ENOMEM; |
118 | 118 | ||
119 | field->name = name; | 119 | field->name = name; |
120 | field->type = type; | 120 | field->type = type; |
@@ -131,11 +131,6 @@ static int __trace_define_field(struct list_head *head, const char *type, | |||
131 | list_add(&field->link, head); | 131 | list_add(&field->link, head); |
132 | 132 | ||
133 | return 0; | 133 | return 0; |
134 | |||
135 | err: | ||
136 | kmem_cache_free(field_cachep, field); | ||
137 | |||
138 | return -ENOMEM; | ||
139 | } | 134 | } |
140 | 135 | ||
141 | int trace_define_field(struct ftrace_event_call *call, const char *type, | 136 | int trace_define_field(struct ftrace_event_call *call, const char *type, |