From: Dan Carpenter Date: Fri, 15 Apr 2016 14:51:06 +0000 (+0300) Subject: PCI: acpiphp_ibm: Avoid uninitialized variable reference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4d88d5a7bf92e31215543b955b8883dcf6f66c1f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Bjorn Helgaas --- 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;