powerpc: Check RTAS extended log flag before checking length
authorAnton Blanchard <anton@samba.org>
Tue, 11 Jan 2011 19:51:31 +0000 (19:51 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 21 Jan 2011 03:08:38 +0000 (14:08 +1100)
The spec suggests we should first check the extended log flag before checking
the length field.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/rtasd.c

index 0438f819fe6b1adf10a16c42f6b32b8b2c75d059..049dbecb5dbc7908eb991642bb629e695590341f 100644 (file)
@@ -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;