Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b84346ef authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Jesse Barnes
Browse files

PCI hotplug: pciehp: fix possible memory leak in pcie_init



Fix the error paths in pcie_init to avoid leaking memory.

Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent a1c19894
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;