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

Commit e22241df authored by Tony Truong's avatar Tony Truong Committed by Matt Wagantall
Browse files

msm: pcie: correct exit code for invalid Root Complex indexes



In the case where the Root Complex fails to retrive a valid
index, the exit code fails to handle this correctly. This
change corrects the way the exit code handles invalid root
complex indexes.

Change-Id: Ie832fec1be2b05dea05b8917348a1c08cdc1d681
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent 50b83b7b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -5057,9 +5057,14 @@ static int msm_pcie_probe(struct platform_device *pdev)
decrease_rc_num:
	pcie_drv.rc_num--;
out:
	if (rc_idx < 0 || rc_idx >= MAX_RC_NUM)
		pr_err("PCIe: Invalid RC index %d. Driver probe failed\n",
		rc_idx);
	else
		PCIE_ERR(&msm_pcie_dev[rc_idx],
			"PCIe: Driver probe failed for RC%d:%d\n",
			rc_idx, ret);

	mutex_unlock(&pcie_drv.drv_lock);

	return ret;