The patch titled Subject: drivers/acpi/apei/einj.c: allow empty Trigger Error Action Table has been added to the -mm tree. Its filename is drivers-acpi-apei-einjc-allow-empty-trigger-error-action-table.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx> Subject: drivers/acpi/apei/einj.c: allow empty Trigger Error Action Table When troubleshooting some BIOS code I encounter strange errors about firmware bugs. On closer inspection I found that the Trigger table returned from the firmware was empty but the header looked OK: header_size = 16 table_size = 16 entry_count = 0 When looking at einj.c I found that this header would result in the error I was receiving. I took a quick look at the docs and from what I can tell this is a valid header, yes? According to the ACPI spec [1] section 18.6.4 the TRIGGER_ERROR action table can consists of zero elements. [1] Advanced Configuration and Power Interface Specification Revision 5.0, December 6, 2011 http://www.acpi.info/DOWNLOADS/ACPIspec50.pdf Signed-off-by: Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Cc: Huang Ying <ying.huang@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/acpi/apei/einj.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff -puN drivers/acpi/apei/einj.c~drivers-acpi-apei-einjc-allow-empty-trigger-error-action-table drivers/acpi/apei/einj.c --- a/drivers/acpi/apei/einj.c~drivers-acpi-apei-einjc-allow-empty-trigger-error-action-table +++ a/drivers/acpi/apei/einj.c @@ -184,7 +184,7 @@ static int einj_check_trigger_header(str if (trigger_tab->header_size != sizeof(struct acpi_einj_trigger)) return -EINVAL; if (trigger_tab->table_size > PAGE_SIZE || - trigger_tab->table_size <= trigger_tab->header_size) + trigger_tab->table_size < trigger_tab->header_size) return -EINVAL; if (trigger_tab->entry_count != (trigger_tab->table_size - trigger_tab->header_size) / @@ -225,6 +225,11 @@ static int __einj_error_trigger(u64 trig "The trigger error action table is invalid\n"); goto out_rel_header; } + + /* No action structures in the TRIGGER_ERROR table, nothing to do */ + if (!trigger_tab->entry_count) + goto out_rel_header; + rc = -EIO; table_size = trigger_tab->table_size; r = request_mem_region(trigger_paddr + sizeof(*trigger_tab), _ Subject: Subject: drivers/acpi/apei/einj.c: allow empty Trigger Error Action Table Patches currently in -mm which might be from niklas.soderlund@xxxxxxxxxxxx are linux-next.patch drivers-acpi-apei-einjc-allow-empty-trigger-error-action-table.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html