public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Use before NULL check in shpchp_ctrl
@ 2004-09-03 21:10 Dave Jones
  2004-09-08 23:51 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2004-09-03 21:10 UTC (permalink / raw)
  To: greg; +Cc: Linux Kernel

More fun found with the coverity checker.

Signed-off-by: Dave Jones <davej@redhat.com>


--- 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);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-08 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-03 21:10 Use before NULL check in shpchp_ctrl Dave Jones
2004-09-08 23:51 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox