PCI: ibmphp: fix get_max_bus_speed()
Subsystems (2)
PATCH 1/1 PCI: ibmphp: fix 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 <[email protected]>
drivers/pci/hotplug/ibmphp_core.c +1 -1
@@ -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;
Bjorn Helgaas
AppliedQuoted 6 lines · Dan Carpenter
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 <[email protected]>
Applied to pci/hotplug for v4.18, thanks!
Quoted 13 lines
drivers/pci/hotplug/ibmphp_core.c +1
-1@@ -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;