ACPI / resources: ignore invalid ACPI device resources
authorZhang Rui <rui.zhang@intel.com>
Thu, 27 Feb 2014 03:37:15 +0000 (11:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Mar 2014 04:44:09 +0000 (21:44 -0700)
commita2f83717197b337ee22b114a0ef7c3bcb65b618c
treedc813dc2588d6eef040b0777a7b88d5cfe63bc5e
parent9a59929c894645615835deb478f99de178530b22
ACPI / resources: ignore invalid ACPI device resources

commit b355cee88e3b1a193f0e9a81db810f6f83ad728b upstream.

ACPI table may export resource entry with 0 length.
But the current code interprets this kind of resource in a wrong way.
It will create a resource structure with
res->end = acpi_resource->start + acpi_resource->len - 1;

This patch fixes a problem on my machine that a platform device fails
to be created because one of its ACPI IO resource entry (start = 0,
end = 0, length = 0) is translated into a generic resource with
start = 0, end = 0xffffffff.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/resource.c