Skip to content

Commit b84346e

Browse files
kkaneshigejbarnes993
authored andcommitted
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>
1 parent a1c1989 commit b84346e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/pci/hotplug/pciehp_hpc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,11 +1147,11 @@ struct controller *pcie_init(struct pcie_device *dev)
11471147
if (!ctrl->cap_base) {
11481148
ctrl_err(ctrl, "%s: Cannot find PCI Express capability\n",
11491149
__func__);
1150-
goto abort;
1150+
goto abort_ctrl;
11511151
}
11521152
if (pciehp_readl(ctrl, SLOTCAP, &slot_cap)) {
11531153
ctrl_err(ctrl, "%s: Cannot read SLOTCAP register\n", __func__);
1154-
goto abort;
1154+
goto abort_ctrl;
11551155
}
11561156

11571157
ctrl->slot_cap = slot_cap;

0 commit comments

Comments
 (0)