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.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d6b60576f991..0a367362ba2f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -36,8 +36,7 @@ unsigned long __read_mostly tracing_max_latency = (cycle_t)ULONG_MAX;
36unsigned long __read_mostly tracing_thresh; 36unsigned long __read_mostly tracing_thresh;
37 37
38/* dummy trace to disable tracing */ 38/* dummy trace to disable tracing */
39static struct tracer no_tracer __read_mostly = 39static struct tracer no_tracer __read_mostly = {
40{
41 .name = "none", 40 .name = "none",
42}; 41};
43 42
@@ -1906,8 +1905,8 @@ tracing_iter_ctrl_write(struct file *filp, const char __user *ubuf,
1906 int neg = 0; 1905 int neg = 0;
1907 int i; 1906 int i;
1908 1907
1909 if (cnt > 63) 1908 if (cnt >= sizeof(buf))
1910 cnt = 63; 1909 return -EINVAL;
1911 1910
1912 if (copy_from_user(&buf, ubuf, cnt)) 1911 if (copy_from_user(&buf, ubuf, cnt))
1913 return -EFAULT; 1912 return -EFAULT;
@@ -1999,8 +1998,8 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
1999 long val; 1998 long val;
2000 char buf[64]; 1999 char buf[64];
2001 2000
2002 if (cnt > 63) 2001 if (cnt >= sizeof(buf))
2003 cnt = 63; 2002 return -EINVAL;
2004 2003
2005 if (copy_from_user(&buf, ubuf, cnt)) 2004 if (copy_from_user(&buf, ubuf, cnt))
2006 return -EFAULT; 2005 return -EFAULT;
@@ -2099,10 +2098,10 @@ tracing_max_lat_read(struct file *filp, char __user *ubuf,
2099 char buf[64]; 2098 char buf[64];
2100 int r; 2099 int r;
2101 2100
2102 r = snprintf(buf, 64, "%ld\n", 2101 r = snprintf(buf, sizeof(buf), "%ld\n",
2103 *ptr == (unsigned long)-1 ? -1 : nsecs_to_usecs(*ptr)); 2102 *ptr == (unsigned long)-1 ? -1 : nsecs_to_usecs(*ptr));
2104 if (r > 64) 2103 if (r > sizeof(buf))
2105 r = 64; 2104 r = sizeof(buf);
2106 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); 2105 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
2107} 2106}
2108 2107
@@ -2114,8 +2113,8 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf,
2114 long val; 2113 long val;
2115 char buf[64]; 2114 char buf[64];
2116 2115
2117 if (cnt > 63) 2116 if (cnt >= sizeof(buf))
2118 cnt = 63; 2117 return -EINVAL;
2119 2118
2120 if (copy_from_user(&buf, ubuf, cnt)) 2119 if (copy_from_user(&buf, ubuf, cnt))
2121 return -EFAULT; 2120 return -EFAULT;
@@ -2378,8 +2377,8 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
2378 unsigned long val; 2377 unsigned long val;
2379 char buf[64]; 2378 char buf[64];
2380 2379
2381 if (cnt > 63) 2380 if (cnt >= sizeof(buf))
2382 cnt = 63; 2381 return -EINVAL;
2383 2382
2384 if (copy_from_user(&buf, ubuf, cnt)) 2383 if (copy_from_user(&buf, ubuf, cnt))
2385 return -EFAULT; 2384 return -EFAULT;