summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-06-07 15:07:48 +0900
committerSteven Rostedt <rostedt@goodmis.org>2013-06-11 18:38:52 -0400
commitaaf6ac0f0871cb7fc0f28f3a00edf329bc7adc29 (patch)
tree44f9ced8832fe8e5d61a7b78a87cf4eef0667ef9
parent1b3d0623cd9da35fe1d52281ed06c2ff543cd660 (diff)
downloadop-kernel-dev-aaf6ac0f0871cb7fc0f28f3a00edf329bc7adc29.zip
op-kernel-dev-aaf6ac0f0871cb7fc0f28f3a00edf329bc7adc29.tar.gz
tracing: Do not call kmem_cache_free() on allocation failure
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>
-rw-r--r--kernel/trace/trace_events.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index db086f1..f57b015 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,
OpenPOWER on IntegriCloud