]> git.hungrycats.org Git - linux/commitdiff
[PATCH] PCI Hotplug: Use before NULL check in shpchp_ctrl
authorDave Jones <davej@redhat.com>
Wed, 6 Oct 2004 11:16:30 +0000 (04:16 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 11:16:30 +0000 (04:16 -0700)
More fun found with the coverity checker.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pci/hotplug/shpchp_ctrl.c

index 7ca8e936993a58cf3409c60b1f788820750c0c89..d71925c26b2510b4452bf37f1e5eb7df1782abe3 100644 (file)
@@ -2163,12 +2163,14 @@ int shpchp_disable_slot (struct slot *p_slot)
        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);