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

Commit 05b5c1f2 authored by Tony Truong's avatar Tony Truong Committed by Gerrit - the friendly Code Review server
Browse files

msm: pcie: fix potential dangling mutex in enumeration



There are two cases where PCIe root complex driver acquires a
mutex and does not release it during the failure case.

Change-Id: I73b3cd66c258243a9da6ef2bb0f560814559a0f8
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent a876aa56
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4379,8 +4379,10 @@ int msm_pcie_enumerate(u32 rc_idx)

			bridge = devm_pci_alloc_host_bridge(&dev->pdev->dev,
						sizeof(*dev));
			if (!bridge)
				return -ENOMEM;
			if (!bridge) {
				ret = -ENOMEM;
				goto out;
			}

			ret = of_pci_get_host_bridge_resources(
						dev->pdev->dev.of_node,
@@ -4404,7 +4406,7 @@ int msm_pcie_enumerate(u32 rc_idx)
			if (IS_ENABLED(CONFIG_PCI_MSM_MSI)) {
				ret = msm_msi_init(&dev->pdev->dev);
				if (ret)
					return ret;
					goto out;
			}

			list_splice_init(&res, &bridge->windows);