Subject: [PATCH 8/9] powerpc: Check RTAS extended log flag before checking length

From: Anton Blanchard <[email-masked]>
Date: Wed, 12 Jan 2011 16:51:31 +1100

The spec suggests we should first check the extended log flag before checking
the length field. 

Signed-off-by: Anton Blanchard <[email-masked]>
---

Index: powerpc.git/arch/powerpc/kernel/rtasd.c
===================================================================
--- powerpc.git.orig/arch/powerpc/kernel/rtasd.c	2010-09-27 21:19:32.405475768 +1000
+++ powerpc.git/arch/powerpc/kernel/rtasd.c	2010-10-15 13:23:42.321361102 +1100
@@ -160,7 +160,7 @@ static int log_rtas_len(char * buf)
 	/* rtas fixed header */
 	len = 8;
 	err = (struct rtas_error_log *)buf;
-	if (err->extended_log_length) {
+	if (err->extended && err->extended_log_length) {
 
 		/* extended header */
 		len += err->extended_log_length;