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

Submitted by Anton Blanchard on Jan. 12, 2011, 5:51 a.m.

Details

Message ID 20110112165131.21910131@kryten
State Accepted, archived
Commit 7f32c9c60089bfdb5eeeaae6e9f59046db998234
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

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 hide | download patch | download mbox

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;