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

Commit ffba4ad6 authored by Tony Truong's avatar Tony Truong
Browse files

msm: pcie: check the return value of irq_get_chip_data



The function irq_get_chip_data may return NULL and derefercing it
will throw an exception. This change checks the return value of
irq_get_chip_data and handles it in the case it is NULL.

Change-Id: I4cc2c94aaa8ab87eb3eb925ef8ae7e4ef929fb11
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent c3879c01
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3121,6 +3121,11 @@ void msm_pcie_destroy_irq(unsigned int irq, struct msm_pcie_dev_t *pcie_dev)
	else
		dev = irq_get_chip_data(irq);

	if (!dev) {
		PCIE_ERR(dev, "RC%d: could not get chip data\n", dev->rc_idx);
		return;
	}

	if (dev->msi_gicm_addr) {
		PCIE_DBG(dev, "destroy QGIC based irq %d\n", irq);
		pos = irq - dev->msi_gicm_base;