* [PATCH] powerpc: fix crash in rtas during early boot.
@ 2007-10-03 18:35 Linas Vepstas
0 siblings, 0 replies; only message in thread
From: Linas Vepstas @ 2007-10-03 18:35 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
RTAS messages can occur very early during boot, before the error
message buffer has been allocated. The current code will lead to
a null-pointer deref. Explicitly protect against this.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Andy Whitcroft <apw@shadowen.org>
----
Andy Whitcroft's crash was appearently due to firmware complaining
about lost power, (actually, lost power supply redundancy!), which
occurred very early during boot.
Type 00000040 (EPOW)
Status: bypassed new
Residual error from previous boot.
EPOW Sensor Value: 00000002
EPOW warning due to loss of redundancy.
EPOW general power fault.
I've no clue why firmware thought it was OK to report this
during one of the earliest calls to RTAS; I'm still investiigating
that.
arch/powerpc/platforms/pseries/rtasd.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/rtasd.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/arch/powerpc/platforms/pseries/rtasd.c 2007-09-26 15:06:49.000000000 -0500
+++ linux-2.6.23-rc8-mm1/arch/powerpc/platforms/pseries/rtasd.c 2007-10-03 11:58:09.000000000 -0500
@@ -235,6 +235,12 @@ void pSeries_log_error(char *buf, unsign
return;
}
+ /* During early boot, the log buffer hasn't been allocted yet. */
+ if (rtas_log_buf == NULL) {
+ spin_unlock_irqrestore(&rtasd_log_lock, s);
+ return;
+ }
+
/* call type specific method for error */
switch (err_type & ERR_TYPE_MASK) {
case ERR_TYPE_RTAS_LOG:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-03 18:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 18:35 [PATCH] powerpc: fix crash in rtas during early boot Linas Vepstas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).