tracing: Remove an unneeded check in trace_seq_buffer()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Apr 2012 06:31:45 +0000 (09:31 +0300)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 24 Apr 2012 01:16:10 +0000 (21:16 -0400)
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>
kernel/trace/trace.c

index 1ab8e35..bbcde54 100644 (file)
@@ -629,7 +629,6 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
 static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
 {
        int len;
-       void *ret;
 
        if (s->len <= s->readpos)
                return -EBUSY;
@@ -637,9 +636,7 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
        len = s->len - s->readpos;
        if (cnt > len)
                cnt = len;
-       ret = memcpy(buf, s->buffer + s->readpos, cnt);
-       if (!ret)
-               return -EFAULT;
+       memcpy(buf, s->buffer + s->readpos, cnt);
 
        s->readpos += cnt;
        return cnt;