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

Commit 6e4d8109 authored by Tony Truong's avatar Tony Truong
Browse files

msm: pcie: fix potential NULL pointer in AER support



When searching for the endpoint that reported the error, it
is possible none will be found. This change handles that case.

Change-Id: I6601d72f0184a5898b37f3c28b88fb2196b39595
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent f8fa637b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3494,7 +3494,7 @@ static irqreturn_t handle_aer_irq(int irq, void *data)

	int corr_val, uncorr_val, rc_err_status, ep_corr_val, ep_uncorr_val;
	int i, j, ep_src_bdf;
	void __iomem *ep_base;
	void __iomem *ep_base = NULL;

	PCIE_DBG(dev, "AER Interrupt handler fired for RC%d irq %d\n",
		dev->rc_idx, irq);
@@ -3542,6 +3542,13 @@ static irqreturn_t handle_aer_irq(int irq, void *data)
			}
		}

		if (!ep_base) {
			PCIE_ERR(dev,
				"PCIe: RC%d no endpoint found for reported error\n",
				dev->rc_idx);
			goto out;
		}

		ep_uncorr_val = readl_relaxed(ep_base +
					PCIE20_AER_UNCORR_ERR_STATUS_REG);
		ep_corr_val = readl_relaxed(ep_base +