diff options
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index f386296ff378..8cd5ed049b5d 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -993,21 +993,24 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, | |||
993 | (struct rtas_ext_event_log_v6 *)log->buffer; | 993 | (struct rtas_ext_event_log_v6 *)log->buffer; |
994 | struct pseries_errorlog *sect; | 994 | struct pseries_errorlog *sect; |
995 | unsigned char *p, *log_end; | 995 | unsigned char *p, *log_end; |
996 | uint32_t ext_log_length = rtas_error_extended_log_length(log); | ||
997 | uint8_t log_format = rtas_ext_event_log_format(ext_log); | ||
998 | uint32_t company_id = rtas_ext_event_company_id(ext_log); | ||
996 | 999 | ||
997 | /* Check that we understand the format */ | 1000 | /* Check that we understand the format */ |
998 | if (log->extended_log_length < sizeof(struct rtas_ext_event_log_v6) || | 1001 | if (ext_log_length < sizeof(struct rtas_ext_event_log_v6) || |
999 | ext_log->log_format != RTAS_V6EXT_LOG_FORMAT_EVENT_LOG || | 1002 | log_format != RTAS_V6EXT_LOG_FORMAT_EVENT_LOG || |
1000 | ext_log->company_id != RTAS_V6EXT_COMPANY_ID_IBM) | 1003 | company_id != RTAS_V6EXT_COMPANY_ID_IBM) |
1001 | return NULL; | 1004 | return NULL; |
1002 | 1005 | ||
1003 | log_end = log->buffer + log->extended_log_length; | 1006 | log_end = log->buffer + ext_log_length; |
1004 | p = ext_log->vendor_log; | 1007 | p = ext_log->vendor_log; |
1005 | 1008 | ||
1006 | while (p < log_end) { | 1009 | while (p < log_end) { |
1007 | sect = (struct pseries_errorlog *)p; | 1010 | sect = (struct pseries_errorlog *)p; |
1008 | if (sect->id == section_id) | 1011 | if (pseries_errorlog_id(sect) == section_id) |
1009 | return sect; | 1012 | return sect; |
1010 | p += sect->length; | 1013 | p += pseries_errorlog_length(sect); |
1011 | } | 1014 | } |
1012 | 1015 | ||
1013 | return NULL; | 1016 | return NULL; |