[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516094147-4597-2-git-send-email-hiraku.toyooka@cybertrust.co.jp>
Date: Tue, 16 Jan 2018 18:15:47 +0900
From: Hiraku Toyooka <hiraku.toyooka@...ertrust.co.jp>
To: bhelgaas@...gle.com
Cc: Hiraku Toyooka <hiraku.toyooka@...ertrust.co.jp>,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, hongxing.zhu@....com,
l.stach@...gutronix.de, jingoohan1@...il.com,
Joao.Pinto@...opsys.com, lorenzo.pieralisi@....com,
linux@...linux.org.uk, will.deacon@....com
Subject: [PATCH 1/1] PCI/MSI: add NULL check before use of msi_desc
On starting kdump kernel in arm, arm64 and powerpc, chip->irq_mask() is
called for each irq_data to mask interrupts. For MSI irqs,
pci_msi_mask_irq() is called even when the irq_data doesn't have a link
to msi_desc. This results in a NULL pointer dereference.
This patch fixes the above error by avoiding NULL msi_desc use.
Signed-off-by: Hiraku Toyooka <hiraku.toyooka@...ertrust.co.jp>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Richard Zhu <hongxing.zhu@....com>
Cc: Lucas Stach <l.stach@...gutronix.de>
Cc: Jingoo Han <jingoohan1@...il.com>
Cc: Joao Pinto <Joao.Pinto@...opsys.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc: Russell King <linux@...linux.org.uk>
Cc: Will Deacon <will.deacon@....com>
---
drivers/pci/msi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index e066071..a6ee274 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -227,6 +227,9 @@ static void msi_set_mask_bit(struct irq_data *data, u32 flag)
{
struct msi_desc *desc = irq_data_get_msi_desc(data);
+ if (!desc)
+ return;
+
if (desc->msi_attrib.is_msix) {
msix_mask_irq(desc, flag);
readl(desc->mask_base); /* Flush write to device */
--
2.7.4
Powered by blists - more mailing lists