PCI hotplug: pciehp: fix possible memory leak in pcie_init
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Wed, 22 Oct 2008 05:30:15 +0000 (14:30 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 22 Oct 2008 23:42:45 +0000 (16:42 -0700)
Fix the error paths in pcie_init to avoid leaking memory.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/pciehp_hpc.c

index 4c74d53..4b92122 100644 (file)
@@ -1147,11 +1147,11 @@ struct controller *pcie_init(struct pcie_device *dev)
        if (!ctrl->cap_base) {
                ctrl_err(ctrl, "%s: Cannot find PCI Express capability\n",
                         __func__);
-               goto abort;
+               goto abort_ctrl;
        }
        if (pciehp_readl(ctrl, SLOTCAP, &slot_cap)) {
                ctrl_err(ctrl, "%s: Cannot read SLOTCAP register\n", __func__);
-               goto abort;
+               goto abort_ctrl;
        }
 
        ctrl->slot_cap = slot_cap;