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

Anton Blanchard anton at samba.org
Wed Jan 12 16:51:31 EST 2011


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

Signed-off-by: Anton Blanchard <anton at samba.org>
---

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;


More information about the Linuxppc-dev mailing list