Use before NULL check in shpchp_ctrl

From: Dave Jones
Date: Fri Sep 03 2004 - 16:13:04 EST


More fun found with the coverity checker.

Signed-off-by: Dave Jones <davej@xxxxxxxxxx>


--- linux-2.6.8/drivers/pci/hotplug/shpchp_ctrl.c~ 2004-09-03 22:08:33.285172888 +0100
+++ linux-2.6.8/drivers/pci/hotplug/shpchp_ctrl.c 2004-09-03 22:09:41.390819256 +0100
@@ -2163,12 +2163,14 @@
u32 rc = 0;
int ret = 0;
unsigned int devfn;
- struct pci_bus *pci_bus = p_slot->ctrl->pci_dev->subordinate;
+ struct pci_bus *pci_bus;
struct pci_func *func;

if (!p_slot->ctrl)
return 1;

+ pci_bus = p_slot->ctrl->pci_dev->subordinate;
+
/* Check to see if (latch closed, card present, power on) */
down(&p_slot->ctrl->crit_sect);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/