From: Kenji Kaneshige Date: Wed, 22 Oct 2008 05:30:15 +0000 (+0900) Subject: PCI hotplug: pciehp: fix possible memory leak in pcie_init X-Git-Tag: v2.6.28-rc1~29^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b84346ef74cf76793070762b933387729c5df1ed;p=linux-2.6-omap-h63xx.git PCI hotplug: pciehp: fix possible memory leak in pcie_init Fix the error paths in pcie_init to avoid leaking memory. Signed-off-by: Kenji Kaneshige Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 4c74d536d45..4b921226f88 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -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;