aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 086d36316805..88b42d14d32d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3498,6 +3498,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
3498 size_t cnt, loff_t *fpos) 3498 size_t cnt, loff_t *fpos)
3499{ 3499{
3500 char *buf; 3500 char *buf;
3501 size_t written;
3501 3502
3502 if (tracing_disabled) 3503 if (tracing_disabled)
3503 return -EINVAL; 3504 return -EINVAL;
@@ -3519,11 +3520,15 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
3519 } else 3520 } else
3520 buf[cnt] = '\0'; 3521 buf[cnt] = '\0';
3521 3522
3522 cnt = mark_printk("%s", buf); 3523 written = mark_printk("%s", buf);
3523 kfree(buf); 3524 kfree(buf);
3524 *fpos += cnt; 3525 *fpos += written;
3525 3526
3526 return cnt; 3527 /* don't tell userspace we wrote more - it might confuse them */
3528 if (written > cnt)
3529 written = cnt;
3530
3531 return written;
3527} 3532}
3528 3533
3529static int tracing_clock_show(struct seq_file *m, void *v) 3534static int tracing_clock_show(struct seq_file *m, void *v)