summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2008-11-11 10:17:45 +0100
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-11-19 23:12:29 +0100
commit1df8fb3d5f078f9cab901b6106ef2c9b74eef7df (patch)
tree48941e9ff7997acb1af25ff2a546a921b383f06f /drivers
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block (diff)
downloadlinux-1df8fb3d5f078f9cab901b6106ef2c9b74eef7df.tar.xz
linux-1df8fb3d5f078f9cab901b6106ef2c9b74eef7df.zip
PCI: Fix disable IRQ 0 in pci_reset_function()
Before initialization, dev->irq may be zero. Make sure we don't disable it at reset time in that case. Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 21f2ac639cab..28af496b441e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1832,7 +1832,7 @@ int pci_reset_function(struct pci_dev *dev)
if (!(cap & PCI_EXP_DEVCAP_FLR))
return -ENOTTY;
- if (!dev->msi_enabled && !dev->msix_enabled)
+ if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0)
disable_irq(dev->irq);
pci_save_state(dev);
@@ -1841,7 +1841,7 @@ int pci_reset_function(struct pci_dev *dev)
r = pci_execute_reset_function(dev);
pci_restore_state(dev);
- if (!dev->msi_enabled && !dev->msix_enabled)
+ if (!dev->msi_enabled && !dev->msix_enabled && dev->irq != 0)
enable_irq(dev->irq);
return r;