diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-15 17:51:06 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-04-15 18:17:03 +0300 |
commit | 4d88d5a7bf92e31215543b955b8883dcf6f66c1f (patch) | |
tree | 2cc30fc737b6cdb6193a36b21129013317d70af7 /drivers/pci/hotplug | |
parent | 9735a22799b9214d17d3c231fe377fc852f042e9 (diff) | |
download | linux-4d88d5a7bf92e31215543b955b8883dcf6f66c1f.tar.xz |
PCI: acpiphp_ibm: Avoid uninitialized variable reference
If ibm_get_table_from_acpi() fails then "table" isn't initialized. Check
for failure so we don't reference "table" unless it's been initialized.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_ibm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index 2f6d3a1c1726..f6221d739f59 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -138,6 +138,8 @@ static union apci_descriptor *ibm_slot_from_id(int id) char *table; size = ibm_get_table_from_acpi(&table); + if (size < 0) + return NULL; des = (union apci_descriptor *)table; if (memcmp(des->header.sig, "aPCI", 4) != 0) goto ibm_slot_done; |