Skip to content
Commit 89935315 authored by Zhang Rui's avatar Zhang Rui Committed by Rafael J. Wysocki
Browse files

PNP / ACPI: proper handling of ACPI IO/Memory resource parsing failures



Before commit b355cee8 (ACPI / resources: ignore invalid ACPI
device resources), if acpi_dev_resource_memory()/acpi_dev_resource_io()
returns false, it means the the resource is not a memeory/IO resource.

But after commit b355cee8, those functions return false if the
given memory/IO resource entry is invalid (the length of the resource
is zero).

This breaks pnpacpi_allocated_resource(), because it now recognizes
the invalid memory/io resources as resources of unknown type.  Thus
users see confusing warning messages on machines with zero length
ACPI memory/IO resources.

Fix the problem by rearranging pnpacpi_allocated_resource() so that
it calls acpi_dev_resource_memory() for memory type and IO type
resources only, respectively.

Fixes: b355cee8 (ACPI / resources: ignore invalid ACPI device resources)
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Reported-and-tested-by: default avatarMarkus Trippelsdorf <markus@trippelsdorf.de>
Reported-and-tested-by: default avatarJulian Wollrath <jwollrath@web.de>
Reported-and-tested-by: default avatarPaul Bolle <pebolle@tiscali.nl>
[rjw: Changelog]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent fa389e22
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment