aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index dff4bee591b9..80898f4870cc 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2655,6 +2655,9 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
2655 char buf[max_tracer_type_len+1]; 2655 char buf[max_tracer_type_len+1];
2656 int i; 2656 int i;
2657 size_t ret; 2657 size_t ret;
2658 int err;
2659
2660 ret = cnt;
2658 2661
2659 if (cnt > max_tracer_type_len) 2662 if (cnt > max_tracer_type_len)
2660 cnt = max_tracer_type_len; 2663 cnt = max_tracer_type_len;
@@ -2668,12 +2671,11 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
2668 for (i = cnt - 1; i > 0 && isspace(buf[i]); i--) 2671 for (i = cnt - 1; i > 0 && isspace(buf[i]); i--)
2669 buf[i] = 0; 2672 buf[i] = 0;
2670 2673
2671 ret = tracing_set_tracer(buf); 2674 err = tracing_set_tracer(buf);
2672 if (!ret) 2675 if (err)
2673 ret = cnt; 2676 return err;
2674 2677
2675 if (ret > 0) 2678 filp->f_pos += ret;
2676 filp->f_pos += ret;
2677 2679
2678 return ret; 2680 return ret;
2679} 2681}