aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/apei/einj.c
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ericsson.com>2012-01-09 10:49:44 -0500
committerLen Brown <len.brown@intel.com>2012-01-23 19:31:11 -0500
commit4c40aed869a200a621b53bcb491c5ee8a34ef5f1 (patch)
treea40591412b41866bf6b4403be6d64f570329973d /drivers/acpi/apei/einj.c
parent1001a3a307ca2425c028fd23b8ad05ad8bb048dd (diff)
ACPI, APEI, EINJ Allow empty Trigger Error Action Table
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@ericsson.com> Acked-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/apei/einj.c')
-rw-r--r--drivers/acpi/apei/einj.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 5b898d4dda99..bb20b03ddc39 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -276,7 +276,7 @@ static int einj_check_trigger_header(struct acpi_einj_trigger *trigger_tab)
276 if (trigger_tab->header_size != sizeof(struct acpi_einj_trigger)) 276 if (trigger_tab->header_size != sizeof(struct acpi_einj_trigger))
277 return -EINVAL; 277 return -EINVAL;
278 if (trigger_tab->table_size > PAGE_SIZE || 278 if (trigger_tab->table_size > PAGE_SIZE ||
279 trigger_tab->table_size <= trigger_tab->header_size) 279 trigger_tab->table_size < trigger_tab->header_size)
280 return -EINVAL; 280 return -EINVAL;
281 if (trigger_tab->entry_count != 281 if (trigger_tab->entry_count !=
282 (trigger_tab->table_size - trigger_tab->header_size) / 282 (trigger_tab->table_size - trigger_tab->header_size) /
@@ -340,6 +340,11 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
340 "The trigger error action table is invalid\n"); 340 "The trigger error action table is invalid\n");
341 goto out_rel_header; 341 goto out_rel_header;
342 } 342 }
343
344 /* No action structures in the TRIGGER_ERROR table, nothing to do */
345 if (!trigger_tab->entry_count)
346 goto out_rel_header;
347
343 rc = -EIO; 348 rc = -EIO;
344 table_size = trigger_tab->table_size; 349 table_size = trigger_tab->table_size;
345 r = request_mem_region(trigger_paddr + sizeof(*trigger_tab), 350 r = request_mem_region(trigger_paddr + sizeof(*trigger_tab),