forked from Minki/linux
PCI/ACPI: Check acpi_resource_to_address64() return value
We should check the acpi_resource_to_address64() return value, which also removes the need to validate the resource type beforehand. No functional change. Found by Coverity (CID 113815). Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
12b03188ab
commit
f6c1c8ff43
@ -100,13 +100,12 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
|
|||||||
{
|
{
|
||||||
struct resource *res = data;
|
struct resource *res = data;
|
||||||
struct acpi_resource_address64 address;
|
struct acpi_resource_address64 address;
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 &&
|
status = acpi_resource_to_address64(resource, &address);
|
||||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 &&
|
if (ACPI_FAILURE(status))
|
||||||
resource->type != ACPI_RESOURCE_TYPE_ADDRESS64)
|
|
||||||
return AE_OK;
|
return AE_OK;
|
||||||
|
|
||||||
acpi_resource_to_address64(resource, &address);
|
|
||||||
if ((address.address_length > 0) &&
|
if ((address.address_length > 0) &&
|
||||||
(address.resource_type == ACPI_BUS_NUMBER_RANGE)) {
|
(address.resource_type == ACPI_BUS_NUMBER_RANGE)) {
|
||||||
res->start = address.minimum;
|
res->start = address.minimum;
|
||||||
|
Loading…
Reference in New Issue
Block a user