lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-5a26c8f0cf1e95106858bb4e23ca6dd14c9b842f@git.kernel.org>
Date:	Wed, 2 May 2012 14:02:20 -0700
From:	tip-bot for Dan Carpenter <dan.carpenter@...cle.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
	fweisbec@...il.com, rostedt@...dmis.org,
	eduard.munteanu@...ux360.ro, tglx@...utronix.de,
	dan.carpenter@...cle.com
Subject: [tip:perf/core] tracing:
  Remove an unneeded check in trace_seq_buffer()

Commit-ID:  5a26c8f0cf1e95106858bb4e23ca6dd14c9b842f
Gitweb:     http://git.kernel.org/tip/5a26c8f0cf1e95106858bb4e23ca6dd14c9b842f
Author:     Dan Carpenter <dan.carpenter@...cle.com>
AuthorDate: Fri, 20 Apr 2012 09:31:45 +0300
Committer:  Steven Rostedt <rostedt@...dmis.org>
CommitDate: Mon, 23 Apr 2012 21:16:10 -0400

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@...il.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
---
 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 1ab8e35..bbcde54 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ