From: Jakub Bogusz Date: Wed, 22 Jun 2005 00:15:29 +0000 (-0700) Subject: [PATCH] ppc32: don't recursively crash in die() on CHRP/PReP machines X-Git-Tag: v2.6.13-rc1~68^2~582^2~112 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a70d439345875d476ede258094356e2acd09b1a1;p=linux-2.6 [PATCH] ppc32: don't recursively crash in die() on CHRP/PReP machines This patch avoids recursive crash (leading to kernel stack overflow) in die() on CHRP/PReP machines when CONFIG_PMAC_BACKLIGHT=y. set_backlight_* functions are placed in pmac section, which is discarded when _machine != _MACH_Pmac. Signed-off-by: Jakub Bogusz Acked-by: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c index c65731e8bc..2ca8ecfeef 100644 --- a/arch/ppc/kernel/traps.c +++ b/arch/ppc/kernel/traps.c @@ -81,8 +81,10 @@ void die(const char * str, struct pt_regs * fp, long err) console_verbose(); spin_lock_irq(&die_lock); #ifdef CONFIG_PMAC_BACKLIGHT - set_backlight_enable(1); - set_backlight_level(BACKLIGHT_MAX); + if (_machine == _MACH_Pmac) { + set_backlight_enable(1); + set_backlight_level(BACKLIGHT_MAX); + } #endif printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); #ifdef CONFIG_PREEMPT