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

login
register
mail settings
Submitter Anton Blanchard
Date Jan. 12, 2011, 5:51 a.m.
Message ID <20110112165131.21910131@kryten>
Download mbox | patch
Permalink /patch/78511/
State Accepted
Commit 7f32c9c60089bfdb5eeeaae6e9f59046db998234
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Anton Blanchard - Jan. 12, 2011, 5:51 a.m.
The spec suggests we should first check the extended log flag before checking
the length field. 

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

Patch

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;