ACPI / resources: ignore invalid ACPI device resources
authorZhang Rui <rui.zhang@intel.com>
Thu, 27 Feb 2014 03:37:15 +0000 (11:37 +0800)
committerJiri Slaby <jslaby@suse.cz>
Sat, 22 Mar 2014 21:01:56 +0000 (22:01 +0100)
commit1ddeb7b86737d0ec23b230d4df0b4663646a9442
treef10a0a77d64dab2036799a6db2917d56f7f295db
parent44ba741a0f470c22c691586dea1e219df757fef2
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: Jiri Slaby <jslaby@suse.cz>
drivers/acpi/resource.c