Commit 9fd5a04d authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

exit: Remove calls of do_exit after noreturn versions of die

On nds32, openrisc, s390, sh, and xtensa the function die never
returns.  Mark die __noreturn so that no one expects die to return.
Remove the do_exit calls after die as they will never be reached.

Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc@lists.librecores.org
Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Cc: linux-xtensa@linux-xtensa.org
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Fixes: 2.3.16
Fixes: 2.3.99-pre8
Fixes: 3f65ce4d ("[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 5")
Fixes: 664eec40 ("nds32: MMU fault handling and page table management")
Fixes: 61e85e36 ("OpenRISC: Memory management")
Link: https://lkml.kernel.org/r/20211020174406.17889-2-ebiederm@xmission.com


Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 6ab80d88
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ DEFINE_SPINLOCK(die_lock);
/*
 * This function is protected against re-entrancy.
 */
void die(const char *str, struct pt_regs *regs, int err)
void __noreturn die(const char *str, struct pt_regs *regs, int err)
{
	struct task_struct *tsk = current;
	static int die_counter;
+1 −5
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@

#include <asm/tlbflush.h>

extern void die(const char *str, struct pt_regs *regs, long err);
extern void __noreturn die(const char *str, struct pt_regs *regs, long err);

/*
 * This is useful to dump out the page tables associated with
@@ -299,10 +299,6 @@ void do_page_fault(unsigned long entry, unsigned long addr,

	show_pte(mm, addr);
	die("Oops", regs, error_code);
	bust_spinlocks(0);
	do_exit(SIGKILL);

	return;

	/*
	 * We ran out of memory, or some other thing happened to us that made
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ void nommu_dump_state(struct pt_regs *regs,
}

/* This is normally the 'Oops' routine */
void die(const char *str, struct pt_regs *regs, long err)
void __noreturn die(const char *str, struct pt_regs *regs, long err)
{

	console_verbose();
+1 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ unsigned long pte_errors; /* updated by do_page_fault() */
 */
volatile pgd_t *current_pgd[NR_CPUS];

extern void die(char *, struct pt_regs *, long);
extern void __noreturn die(char *, struct pt_regs *, long);

/*
 * This routine handles page faults.  It determines the address,
@@ -248,8 +248,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address,

	die("Oops", regs, write_acc);

	do_exit(SIGKILL);

	/*
	 * We ran out of memory, or some other thing happened to us that made
	 * us unable to handle the page fault gracefully.
+1 −1
Original line number Diff line number Diff line
@@ -23,6 +23,6 @@ enum die_val {
	DIE_NMI_IPI,
};

extern void die(struct pt_regs *, const char *);
extern void __noreturn die(struct pt_regs *, const char *);

#endif
Loading