aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2007-05-11 16:26:44 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 19:01:18 -0400
commitb3b7cc7b4138f4171da5813b5ec2a14835e02482 (patch)
treebbace1c3424507cc1e6008e7f21dc2eba1332b47 /drivers/pci/msi.c
parent0a3fd051c7036ef71b58863f8e5da7c3dabd9d3f (diff)
Fix assertion failure with MSI on sparc64
Today's find is a triggered assertion in msi_free_irqs() when the system doesn't support MSI, in which case arch_setup_msi_irqs() always returns an error. The problem is that when this happens we branch into msi_free_irqs(), to which you added the following assertion loop: list_for_each_entry(entry, &dev->msi_list, list) BUG_ON(irq_has_action(entry->irq)); Well, if arch_setup_msi_irqs() fails, entry->irq will be zero and although that's never assigned to any normal devices we use that IRQ number for the timer interrupt on sparc64 so this assertion triggers. Better to test for zero before doing the irq_has_action() assertion thing. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index e6740d1a0824..d9cbd586ae4b 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -549,8 +549,10 @@ static int msi_free_irqs(struct pci_dev* dev)
549{ 549{
550 struct msi_desc *entry, *tmp; 550 struct msi_desc *entry, *tmp;
551 551
552 list_for_each_entry(entry, &dev->msi_list, list) 552 list_for_each_entry(entry, &dev->msi_list, list) {
553 BUG_ON(irq_has_action(entry->irq)); 553 if (entry->irq)
554 BUG_ON(irq_has_action(entry->irq));
555 }
554 556
555 arch_teardown_msi_irqs(dev); 557 arch_teardown_msi_irqs(dev);
556 558