[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160415145106.GH8953@mwanda>
Date: Fri, 15 Apr 2016 17:51:06 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Len Brown <lenb@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
linux-acpi@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] PCI: acpiphp_ibm: potential uninitialized variable bug
If ibm_get_table_from_acpi() fails then "table" isn't initialized. I
fixed this by adding a check for failure.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 2f6d3a1..f6221d7 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;
Powered by blists - more mailing lists