Skip to contentSkip to conversation

uprobes: fix return value in error handling path

PATCH In review zhangwei(Jovi) 2 participants 3 messages Jun 13, 2013 – Jul 2, 2013 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uprobes: fix return value in error handling path

When I inject incorrect argument into uprobe_events,

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

it doesn't return any error value in there, this patch fix it.

---
 kernel/trace/trace_uprobe.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/trace/trace_uprobe.c +3 -1
index 32494fb0..d5d0cd3 100644
@@ -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];
Signature · 1 line
1.7.9.7
maintainer
#1 lore raw

Srikar,

Can you give an Ack (or nack) for this?

Thanks,

-- Steve

Quoted 28 lines · zhangwei(Jovi)

When I inject incorrect argument into uprobe_events,

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

it doesn't return any error value in there, this patch fix it.

---
 kernel/trace/trace_uprobe.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/trace/trace_uprobe.c +3 -1
index 32494fb0..d5d0cd3 100644
@@ -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];
maintainer
#2 lore raw
Quoted 4 lines · Steven Rostedt

Srikar,

Can you give an Ack (or nack) for this?

This looks rather obvious, I'll apply it and also tag it for stable.

-- Steve