From: Markus Elfring Date: Sat, 21 Jan 2017 14:30:15 +0000 (+0100) Subject: powerpc/sstep: Return directly after a failed address_ok() in emulate_step() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=3c4b66a6d0d2b9f2418f9a09d528e42e2dc18acf;p=openwrt%2Fstaging%2Fblogic.git powerpc/sstep: Return directly after a failed address_ok() in emulate_step() Setting err and going to ldst_done just returns 0, without using err, so just return 0 directly. We already do that for other call sites in this function. Signed-off-by: Markus Elfring [mpe: Rewrite change log] Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 06c7e9b88408..846dba2c6360 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1803,9 +1803,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) return 0; if (op.ea & (size - 1)) break; /* can't handle misaligned */ - err = -EFAULT; if (!address_ok(regs, op.ea, size)) - goto ldst_done; + return 0; err = 0; switch (size) { case 4: @@ -1828,9 +1827,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) return 0; if (op.ea & (size - 1)) break; /* can't handle misaligned */ - err = -EFAULT; if (!address_ok(regs, op.ea, size)) - goto ldst_done; + return 0; err = 0; switch (size) { case 4: