ACPI: Prevent acpi_table_entries from falling into a infinite loop
authorMalcolm Crossley <malcolm.crossley@citrix.com>
Wed, 4 Jun 2014 09:26:15 +0000 (11:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Jun 2014 09:26:15 +0000 (11:26 +0200)
commit9c1e8cae657bc13e8b1ddeede17603d77f3ad341
tree180cb1d9c6b1f887d26295ca71ae13e36f7e8022
parent9e47f7056ba9f4a3ecf67e41ce79443100036a20
ACPI: Prevent acpi_table_entries from falling into a infinite loop

If a buggy BIOS programs an ACPI table with to small an entry length
then acpi_table_entries gets stuck in an infinite loop.

To aid debugging, report the error and exit the loop.

Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Use < instead of <= (which I wrongly suggested), return -ENODATA
instead of -EINVAL, and make description match code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/acpi/tables.c