[Devel] [PATCH] sparc{, 64}: propagate ptrace_traceme() return value

Alexey Dobriyan adobriyan at openvz.org
Wed Nov 29 00:42:09 PST 2006


ptrace_traceme() consolidation made

	ret = ptrace_traceme();

dead write.

Signed-off-by: Alexey Dobriyan <adobriyan at openvz.org>
---

 arch/sparc/kernel/ptrace.c   |    5 ++++-
 arch/sparc64/kernel/ptrace.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

--- a/arch/sparc/kernel/ptrace.c
+++ b/arch/sparc/kernel/ptrace.c
@@ -289,7 +289,10 @@ #endif
 
 	if (request == PTRACE_TRACEME) {
 		ret = ptrace_traceme();
-		pt_succ_return(regs, 0);
+		if (ret < 0)
+			pt_error_return(regs, -ret);
+		else
+			pt_succ_return(regs, 0);
 		goto out;
 	}
 
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -202,7 +202,10 @@ #ifdef DEBUG_PTRACE
 #endif
 	if (request == PTRACE_TRACEME) {
 		ret = ptrace_traceme();
-		pt_succ_return(regs, 0);
+		if (ret < 0)
+			pt_error_return(regs, -ret);
+		else
+			pt_succ_return(regs, 0);
 		goto out;
 	}
 




More information about the Devel mailing list