提交 5a26c8f0 编写于 作者: D Dan Carpenter 提交者: Steven Rostedt

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 07d777fe
...@@ -629,7 +629,6 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt) ...@@ -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) static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
{ {
int len; int len;
void *ret;
if (s->len <= s->readpos) if (s->len <= s->readpos)
return -EBUSY; return -EBUSY;
...@@ -637,9 +636,7 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) ...@@ -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; len = s->len - s->readpos;
if (cnt > len) if (cnt > len)
cnt = len; cnt = len;
ret = memcpy(buf, s->buffer + s->readpos, cnt); memcpy(buf, s->buffer + s->readpos, cnt);
if (!ret)
return -EFAULT;
s->readpos += cnt; s->readpos += cnt;
return cnt; return cnt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册