diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a8fe4782ebad..5c5cb9be8e8c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2561,12 +2561,12 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2561 | 2561 | ||
2562 | if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { | 2562 | if (ftrace_graph_count >= FTRACE_GRAPH_MAX_FUNCS) { |
2563 | ret = -EBUSY; | 2563 | ret = -EBUSY; |
2564 | goto out; | 2564 | goto out_unlock; |
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { | 2567 | if (trace_parser_get_init(&parser, FTRACE_BUFF_MAX)) { |
2568 | ret = -ENOMEM; | 2568 | ret = -ENOMEM; |
2569 | goto out; | 2569 | goto out_unlock; |
2570 | } | 2570 | } |
2571 | 2571 | ||
2572 | read = trace_get_user(&parser, ubuf, cnt, ppos); | 2572 | read = trace_get_user(&parser, ubuf, cnt, ppos); |
@@ -2578,12 +2578,14 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2578 | ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, | 2578 | ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count, |
2579 | parser.buffer); | 2579 | parser.buffer); |
2580 | if (ret) | 2580 | if (ret) |
2581 | goto out; | 2581 | goto out_free; |
2582 | } | 2582 | } |
2583 | 2583 | ||
2584 | ret = read; | 2584 | ret = read; |
2585 | out: | 2585 | |
2586 | out_free: | ||
2586 | trace_parser_put(&parser); | 2587 | trace_parser_put(&parser); |
2588 | out_unlock: | ||
2587 | mutex_unlock(&graph_lock); | 2589 | mutex_unlock(&graph_lock); |
2588 | 2590 | ||
2589 | return ret; | 2591 | return ret; |