diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-04-20 02:31:45 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-04-23 21:16:10 -0400 |
commit | 5a26c8f0cf1e95106858bb4e23ca6dd14c9b842f (patch) | |
tree | 0e4d5a45f2ce667f3560a9171e11178437ca24a5 /kernel/trace/trace.c | |
parent | 07d777fe8c3985bc83428c2866713c2d1b3d4129 (diff) |
tracing: Remove an unneeded check in trace_seq_buffer()
memcpy() returns a pointer to "bug". Hopefully, it's not NULL here or
we would already have Oopsed.
Link: http://lkml.kernel.org/r/20120420063145.GA22649@elgon.mountain
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 1ab8e35d069b..bbcde546f9f7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -629,7 +629,6 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt) | |||
629 | static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) | 629 | static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) |
630 | { | 630 | { |
631 | int len; | 631 | int len; |
632 | void *ret; | ||
633 | 632 | ||
634 | if (s->len <= s->readpos) | 633 | if (s->len <= s->readpos) |
635 | return -EBUSY; | 634 | return -EBUSY; |
@@ -637,9 +636,7 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) | |||
637 | len = s->len - s->readpos; | 636 | len = s->len - s->readpos; |
638 | if (cnt > len) | 637 | if (cnt > len) |
639 | cnt = len; | 638 | cnt = len; |
640 | ret = memcpy(buf, s->buffer + s->readpos, cnt); | 639 | memcpy(buf, s->buffer + s->readpos, cnt); |
641 | if (!ret) | ||
642 | return -EFAULT; | ||
643 | 640 | ||
644 | s->readpos += cnt; | 641 | s->readpos += cnt; |
645 | return cnt; | 642 | return cnt; |