diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-22 01:48:50 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-05-15 12:51:14 -0400 |
commit | f6c1c8ff439ccadc333b3920c7073e0792bcb9af (patch) | |
tree | 42f39dc409ce0e70d540d08ed40ca4c8202e6e2e /drivers/acpi/pci_root.c | |
parent | 12b03188ab2afed784e416b4fb1366b4a6915ac0 (diff) |
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>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 1dd6f6c85874..f6c0998f248a 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -100,13 +100,12 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) | |||
100 | { | 100 | { |
101 | struct resource *res = data; | 101 | struct resource *res = data; |
102 | struct acpi_resource_address64 address; | 102 | struct acpi_resource_address64 address; |
103 | acpi_status status; | ||
103 | 104 | ||
104 | if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && | 105 | status = acpi_resource_to_address64(resource, &address); |
105 | resource->type != ACPI_RESOURCE_TYPE_ADDRESS32 && | 106 | if (ACPI_FAILURE(status)) |
106 | resource->type != ACPI_RESOURCE_TYPE_ADDRESS64) | ||
107 | return AE_OK; | 107 | return AE_OK; |
108 | 108 | ||
109 | acpi_resource_to_address64(resource, &address); | ||
110 | if ((address.address_length > 0) && | 109 | if ((address.address_length > 0) && |
111 | (address.resource_type == ACPI_BUS_NUMBER_RANGE)) { | 110 | (address.resource_type == ACPI_BUS_NUMBER_RANGE)) { |
112 | res->start = address.minimum; | 111 | res->start = address.minimum; |