提交 9ec9b5ac 编写于 作者: R Ralf Baechle

MIPS: Fix harmlessly missing else statement.

The actual bug is a missing else statement - but really this should be
expressed using a switch() statement.

Found by Al Viro who writes "the funny thing is, it *does* work only
because r2 is syscall number and syscall number around 512 => return
value being ENOSYS and not one of ERESTART...  so we really can't hit
the first if and emerge from it with ERESTART_RESTARTBLOCK.  still
wrong to write it that way..."
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 90c9e79f
...@@ -568,17 +568,20 @@ static void do_signal(struct pt_regs *regs) ...@@ -568,17 +568,20 @@ static void do_signal(struct pt_regs *regs)
} }
if (regs->regs[0]) { if (regs->regs[0]) {
if (regs->regs[2] == ERESTARTNOHAND || switch (regs->regs[2]) {
regs->regs[2] == ERESTARTSYS || case ERESTARTNOHAND:
regs->regs[2] == ERESTARTNOINTR) { case ERESTARTSYS:
case ERESTARTNOINTR:
regs->regs[2] = regs->regs[0]; regs->regs[2] = regs->regs[0];
regs->regs[7] = regs->regs[26]; regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 4; regs->cp0_epc -= 4;
} break;
if (regs->regs[2] == ERESTART_RESTARTBLOCK) {
case ERESTART_RESTARTBLOCK:
regs->regs[2] = current->thread.abi->restart; regs->regs[2] = current->thread.abi->restart;
regs->regs[7] = regs->regs[26]; regs->regs[7] = regs->regs[26];
regs->cp0_epc -= 4; regs->cp0_epc -= 4;
break;
} }
regs->regs[0] = 0; /* Don't deal with this again. */ regs->regs[0] = 0; /* Don't deal with this again. */
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册