public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	<srikar@linux.vnet.ibm.com>, <stable@vger.kernel.org>,
	"zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Subject: [for-next][PATCH 3/8] uprobes: Fix return value in error handling path
Date: Wed, 03 Jul 2013 07:36:38 -0400	[thread overview]
Message-ID: <20130703113718.846774035@goodmis.org> (raw)
In-Reply-To: 20130703113635.696310819@goodmis.org

[-- Attachment #1: 0003-uprobes-Fix-return-value-in-error-handling-path.patch --]
[-- Type: text/plain, Size: 1153 bytes --]

From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>

When wrong argument is passed into uprobe_events it does not return
an error:

[root@jovi tracing]# echo 'p:myprobe /bin/bash' > uprobe_events
[root@jovi tracing]#

The proper response is:

[root@jovi tracing]# echo 'p:myprobe /bin/bash' > uprobe_events
-bash: echo: write error: Invalid argument

Link: http://lkml.kernel.org/r/51B964FF.5000106@huawei.com

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: <srikar@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 3.5+
Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_uprobe.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 32494fb0..d5d0cd3 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -283,8 +283,10 @@ static int create_trace_uprobe(int argc, char **argv)
 		return -EINVAL;
 	}
 	arg = strchr(argv[1], ':');
-	if (!arg)
+	if (!arg) {
+		ret = -EINVAL;
 		goto fail_address_parse;
+	}
 
 	*arg++ = '\0';
 	filename = argv[1];
-- 
1.7.10.4



  parent reply	other threads:[~2013-07-03 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 11:36 [for-next][PATCH 0/8] tracing: Some more last minute fixes Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 1/8] tracing: Add trace_array_get/put() to event handling Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 2/8] tracing: Fix race between deleting buffer and setting events Steven Rostedt
2013-07-03 11:36 ` Steven Rostedt [this message]
2013-07-03 11:36 ` [for-next][PATCH 4/8] tracing: Fix irqs-off tag display in syscall tracing Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 5/8] tracing: Make tracer_tracing_{off,on,is_on}() static Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 6/8] tracing: Remove TRACE_EVENT_TYPE enum definition Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 7/8] tracing: Remove ftrace() function Steven Rostedt
2013-07-03 11:36 ` [for-next][PATCH 8/8] tracing: Make tracing_open_generic_{tr,tc}() static Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130703113718.846774035@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=jovi.zhangwei@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox