All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] tracing: Remove an unneeded check
@ 2012-04-20  6:31 ` Dan Carpenter
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2012-04-20  6:31 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Frederic Weisbecker, Eduard - Gabriel Munteanu, Ingo Molnar,
	linux-kernel, kernel-janitors

memcpy() returns a pointer to "bug".  Hopefully, it's not NULL here or
we would already have Oopsed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ed7b5d1..c2d5b71 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)
 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;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-02 21:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20  6:31 [patch] tracing: Remove an unneeded check Dan Carpenter
2012-04-20  6:31 ` Dan Carpenter
2012-04-20 13:51 ` Steven Rostedt
2012-04-20 13:51   ` Steven Rostedt
2012-04-20 14:03   ` Dan Carpenter
2012-04-20 14:03     ` Dan Carpenter
2012-04-20 14:26     ` Steven Rostedt
2012-04-20 14:26       ` Steven Rostedt
2012-05-02 21:02 ` [tip:perf/core] tracing: Remove an unneeded check in trace_seq_buffer() tip-bot for Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.