summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-04-19 13:05:49 +0300
committerBjorn Helgaas <bhelgaas@google.com>2018-04-20 12:49:24 -0500
commit4051f5ebb11c6ef4b0d3eac2fbbd187c070656c5 (patch)
tree697d8ae693e58a9a66597bd04004be907e3886c2 /drivers/pci/hotplug
parent60cc43fc888428bb2f18f08997432d426a243338 (diff)
downloadblackbird-op-linux-4051f5ebb11c6ef4b0d3eac2fbbd187c070656c5.tar.gz
blackbird-op-linux-4051f5ebb11c6ef4b0d3eac2fbbd187c070656c5.zip
PCI: ibmphp: Fix use-before-set in get_max_bus_speed()
The "rc" variable is only initialized on the error path. The caller doesn't check the return but, if "rc" is non-zero, then this function is basically a no-op. Fixes: 3749c51ac6c1 ("PCI: Make current and maximum bus speeds part of the PCI core") 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/ibmphp_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index b81ca3fa0e84..1869b0411ce0 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -379,7 +379,7 @@ static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 *value)
static int get_max_bus_speed(struct slot *slot)
{
- int rc;
+ int rc = 0;
u8 mode = 0;
enum pci_bus_speed speed;
struct pci_bus *bus = slot->hotplug_slot->pci_slot->bus;
OpenPOWER on IntegriCloud