summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2021-12-22 16:52:26 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 09:04:28 +0100
commitc6a13329a4e672974349fe6acb1bea31da0785ff (patch)
tree3f7af46f9bb8db5c28bfeaa1224e8ebe0c9f6757 /arch
parent53e86c9e1ece2146e71f9db2443277dba8bbfcf0 (diff)
parisc: Avoid calling faulthandler_disabled() twice
[ Upstream commit 9e9d4b460f23bab61672eae397417d03917d116c ] In handle_interruption(), we call faulthandler_disabled() to check whether the fault handler is not disabled. If the fault handler is disabled, we immediately call do_page_fault(). It then calls faulthandler_disabled(). If disabled, do_page_fault() attempts to fixup the exception by jumping to no_context: no_context: if (!user_mode(regs) && fixup_exception(regs)) { return; } parisc_terminate("Bad Address (null pointer deref?)", regs, code, address); Apart from the error messages, the two blocks of code perform the same function. We can avoid two calls to faulthandler_disabled() by a simple revision to the code in handle_interruption(). Note: I didn't try to fix the formatting of this code block. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/traps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index abeb5321a83f..d7a66d852509 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -750,7 +750,7 @@ void notrace handle_interruption(int code, struct pt_regs *regs)
* unless pagefault_disable() was called before.
*/
- if (fault_space == 0 && !faulthandler_disabled())
+ if (faulthandler_disabled() || fault_space == 0)
{
/* Clean up and return if in exception table. */
if (fixup_exception(regs))