projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9735a22
)
PCI: acpiphp_ibm: Avoid uninitialized variable reference
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 15 Apr 2016 14:51:06 +0000
(17:51 +0300)
committer
Bjorn Helgaas
<bhelgaas@google.com>
Fri, 15 Apr 2016 15:17:03 +0000
(10:17 -0500)
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>
drivers/pci/hotplug/acpiphp_ibm.c
patch
|
blob
|
history
diff --git
a/drivers/pci/hotplug/acpiphp_ibm.c
b/drivers/pci/hotplug/acpiphp_ibm.c
index
2f6d3a1
..
f6221d7
100644
(file)
--- 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;