Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d88d5a7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Bjorn Helgaas
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 9735a227
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -138,6 +138,8 @@ static union apci_descriptor *ibm_slot_from_id(int id)
	char *table;
	char *table;


	size = ibm_get_table_from_acpi(&table);
	size = ibm_get_table_from_acpi(&table);
	if (size < 0)
		return NULL;
	des = (union apci_descriptor *)table;
	des = (union apci_descriptor *)table;
	if (memcmp(des->header.sig, "aPCI", 4) != 0)
	if (memcmp(des->header.sig, "aPCI", 4) != 0)
		goto ibm_slot_done;
		goto ibm_slot_done;