From 144cda220ba4d3be92d636ed01b454589dc85c32 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 23 Mar 2015 18:48:32 +0000 Subject: [PATCH] Move get_regs error check from trace_syscall_entering to get_scno Starting with commit v4.10-25-g8497b62, get_scno() can be called outside trace_syscall_entering(), so move the get_regs_error check from trace_syscall_entering() to get_scno(). * syscall.c (trace_syscall_entering): Move get_regs_error check ... (get_scno): ... here. --- syscall.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/syscall.c b/syscall.c index e42b8053..2bc82ca0 100644 --- a/syscall.c +++ b/syscall.c @@ -1129,6 +1129,9 @@ get_regs(pid_t pid) int get_scno(struct tcb *tcp) { + if (get_regs_error) + return -1; + long scno = 0; #if defined(S390) || defined(S390X) @@ -1752,7 +1755,7 @@ trace_syscall_entering(struct tcb *tcp) { int res, scno_good; - scno_good = res = (get_regs_error ? -1 : get_scno(tcp)); + scno_good = res = get_scno(tcp); if (res == 0) return res; if (res == 1) -- 2.40.0