summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-15 16:51:06 +0200
committerBjorn Helgaas <bhelgaas@google.com>2016-04-15 17:17:03 +0200
commit4d88d5a7bf92e31215543b955b8883dcf6f66c1f (patch)
tree2cc30fc737b6cdb6193a36b21129013317d70af7 /drivers/pci/hotplug
parentLinux 4.6-rc2 (diff)
downloadlinux-4d88d5a7bf92e31215543b955b8883dcf6f66c1f.tar.xz
linux-4d88d5a7bf92e31215543b955b8883dcf6f66c1f.zip
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.c2
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;