Commit aaf6ac0f authored by Namhyung Kim's avatar Namhyung Kim Committed by Steven Rostedt

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.orgSigned-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 1b3d0623
...@@ -97,7 +97,7 @@ static int __trace_define_field(struct list_head *head, const char *type, ...@@ -97,7 +97,7 @@ static int __trace_define_field(struct list_head *head, const char *type,
field = kmem_cache_alloc(field_cachep, GFP_TRACE); field = kmem_cache_alloc(field_cachep, GFP_TRACE);
if (!field) if (!field)
goto err; return -ENOMEM;
field->name = name; field->name = name;
field->type = type; field->type = type;
...@@ -114,11 +114,6 @@ static int __trace_define_field(struct list_head *head, const char *type, ...@@ -114,11 +114,6 @@ static int __trace_define_field(struct list_head *head, const char *type,
list_add(&field->link, head); list_add(&field->link, head);
return 0; return 0;
err:
kmem_cache_free(field_cachep, field);
return -ENOMEM;
} }
int trace_define_field(struct ftrace_event_call *call, const char *type, int trace_define_field(struct ftrace_event_call *call, const char *type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment