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 <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Kenji Kaneshige 2008-10-22 14:30:15 +09:00 committed by Jesse Barnes
parent a1c19894b7
commit b84346ef74

View File

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