Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7bbb0ce authored by Alexander van Heukelum's avatar Alexander van Heukelum Committed by Ingo Molnar
Browse files

x86: traps_xx: modify do_trap



if (cond) block -> if (!cond) goto end_of_block

Signed-off-by: default avatarAlexander van Heukelum <heukelum@fastmail.fm>
Acked-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e423f49f
Loading
Loading
Loading
Loading
+28 −28
Original line number Original line Diff line number Diff line
@@ -630,16 +630,17 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
{
{
	struct task_struct *tsk = current;
	struct task_struct *tsk = current;


	if (user_mode(regs)) {
	if (!user_mode(regs))
		goto kernel_trap;

	/*
	/*
		 * We want error_code and trap_no set for userspace
	 * We want error_code and trap_no set for userspace faults and
		 * faults and kernelspace faults which result in
	 * kernelspace faults which result in die(), but not
		 * die(), but not kernelspace faults which are fixed
	 * kernelspace faults which are fixed up.  die() gives the
		 * up.  die() gives the process no chance to handle
	 * process no chance to handle the signal and notice the
		 * the signal and notice the kernel fault information,
	 * kernel fault information, so that won't result in polluting
		 * so that won't result in polluting the information
	 * the information about previously queued, but not yet
		 * about previously queued, but not yet delivered,
	 * delivered, faults.  See also do_general_protection below.
		 * faults.  See also do_general_protection below.
	 */
	 */
	tsk->thread.error_code = error_code;
	tsk->thread.error_code = error_code;
	tsk->thread.trap_no = trapnr;
	tsk->thread.trap_no = trapnr;
@@ -659,9 +660,8 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
	else
	else
		force_sig(signr, tsk);
		force_sig(signr, tsk);
	return;
	return;
	}



kernel_trap:
	if (!fixup_exception(regs)) {
	if (!fixup_exception(regs)) {
		tsk->thread.error_code = error_code;
		tsk->thread.error_code = error_code;
		tsk->thread.trap_no = trapnr;
		tsk->thread.trap_no = trapnr;