Skip to contentSkip to conversation

Use before NULL check in shpchp_ctrl

PATCH Applied Dave Jones 2 participants 2 messages Sep 3, 2004 – Sep 8, 2004 PCI

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

More fun found with the coverity checker.

drivers/pci/hotplug/shpchp_ctrl.c renamed from drivers/pci/hotplug/shpchp_ctrl.c~ +3 -1
@@ -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);