diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2009-06-21 22:33:07 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-07-20 12:02:09 -0400 |
commit | ff4e9da2330beb8d64498a513d3f9694e941b01a (patch) | |
tree | c45a1d50d1f9a015af9497afe8f17b6025200efd /kernel/trace/trace.c | |
parent | 7d536cb3fb9993bdcd5a2fbaa6b0670ded4e101c (diff) |
tracing: cleanup for tracing_trace_options_read()
'\n' is already appended, and what we need is just an extra
space for the '\0'.
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
LKML-Reference: <4A3EED63.3090908@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e30e6b1dbd4e..38a4a3ee749d 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2256,8 +2256,8 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf, | |||
2256 | len += 3; /* "no" and newline */ | 2256 | len += 3; /* "no" and newline */ |
2257 | } | 2257 | } |
2258 | 2258 | ||
2259 | /* +2 for \n and \0 */ | 2259 | /* +1 for \0 */ |
2260 | buf = kmalloc(len + 2, GFP_KERNEL); | 2260 | buf = kmalloc(len + 1, GFP_KERNEL); |
2261 | if (!buf) { | 2261 | if (!buf) { |
2262 | mutex_unlock(&trace_types_lock); | 2262 | mutex_unlock(&trace_types_lock); |
2263 | return -ENOMEM; | 2263 | return -ENOMEM; |
@@ -2280,7 +2280,7 @@ tracing_trace_options_read(struct file *filp, char __user *ubuf, | |||
2280 | } | 2280 | } |
2281 | mutex_unlock(&trace_types_lock); | 2281 | mutex_unlock(&trace_types_lock); |
2282 | 2282 | ||
2283 | WARN_ON(r >= len + 2); | 2283 | WARN_ON(r >= len + 1); |
2284 | 2284 | ||
2285 | r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r); | 2285 | r = simple_read_from_buffer(ubuf, cnt, ppos, buf, r); |
2286 | 2286 | ||